Is there bestsellers snippet yet?

seanie_morris

Was there any movement on this snippet? It would be a nice little addition...

Seanie.

dbs

#21
i could also need this "Other buyers also bought...".

At the moment i dublicate some items into a extra bakery-section and call this section with a modified last-items-script and let order by position.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

Bug

working on that one ...

needs quite some creative thinking ... and puzzling ...

zirzy

That would be cool idea for Bakery! So this snippet gives customer more hints what other customers have bought with this specific product. So choice is already made for customer ;) NICE!

I have to test this in the future :)

Bug

Next thing:

Other buyers also bought...

Idea: in the view_item  (detail page) randomly display two or three items that have been bought by people that bought that specific item...

Can be made from any_items

Might be possible without altering bakery...

Code can be easily insterted into view detailed info with showsection droplet

Show section droplet needs to have extra lines like

If (empty($content)){
$content=' ';
}else{
$content = $content;
}
To prevent having errors if there are no items to display....

zirzy

#17
Here is last items modifyed to bestsellers (see attachment). Is it ok?
I tested bestseller snippet together with last items and it worked fine.

[gelöscht durch Administrator]

Bug

Change everytime lastitems occurs into bestsellers, do NOT forget the info file

So when you install them, both last items and bestsellers get installed

Last items is a rather smal set of files so it is easy to do by hand, with larger amounts of files I usually use dreamweavers find and replace (case sensitive) to replace all instances of the modulenam and directory...

Search for last_items and LAST_ITEMS


With acts like these you can for instance even change 'bakery' into something called 'shop'

zirzy

One question:
If I wanna use last items and bestsellers together. Do i have to change from include.php (rows 29 and 30) function_exists(last_items) to for example function_exists(bestsellers) and call it on my template index.php with the same name?

zirzy

Yes I know ;) Thank you very much Bug. That would be great idea to add it in the new version of Bakery. I will look forward to this new Bakery :)

Bug

@ zirzy:
Freesbee responded positive and with any luck the bestsellersfunction and snippet can be a standard thing in the near future ...

Bug

you know how to style the last_items?...

as this is made from last items you can style is the same way, in the enclosed file above I already made a possibillity to show the amount of sold items ...


if freesbee reads this... if you can put in the bestsellers-field into the next release + the minor alterations to the view.php the snippet could be a standard usable snippet ...



zirzy

How nice is that! :) Thank you Bug! I have to test this as soon as possible (now i have to work).

Thanks again!! ;)

Bug

#10
last step:

install the last_items and change the way it orders the items ...


$query_items = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_items WHERE active = '1' AND title != '' ORDER BY bestseller DESC LIMIT ".$num_items);


you can even show the amount of items that are sold:

[gelöscht durch Administrator]

Bug

#9
now with these minor changes we keep track of how many times an item is bought ...

as we test it, and buy 40 sjits where the stock was 50 sjits, we see 10 sjits remaining in stock and 40 sjits in bestsellerfield ...


Bug

2nd step:

add some stuff in view.php

what is already there?
whenever an amount of items is bought, the stock amount of those items are decreased by some lines like

$database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = stock - '$quantity' WHERE item_id = '$item_id'");

what do we want?
we want that at the same time as the stock is updated to update the field 'bestseller' and decrease the amount for that field with the amount of bought items ..

so we add
$database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET bestseller = bestseller + '$quantity' WHERE item_id = '$item_id'");

these lines apear several times in the view.php

enclosed a view.php from the latest bakery version


[gelöscht durch Administrator]

Bug

#7
first step:

add a field to the bakery_item table

I called it bestseller

name: bestseller
set it to: int

do not set it to varchar because that will occur in not sorting the right way

Bug

I am off to work right now, will try the new baker (I presume to functions are still just as lame as they where last update),

I will first make a snippet for my 'slighty' altered backery-with-another-name and when it works I will post it...

Can't be too hard...

dbs

QuoteI´m looking forward to this
me too  :wink:
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

zirzy

Hi Bug,

Thanks for your help! I´m looking forward to this ;)

Bug

I guess the item table needs an extra field where you can keep track of the amount of items that are sold

With that variable you can select the bestsellers

I guess in the view_summary you should add the new amount to the existing amount

I see nice possibilities, I will take this up soon

zirzy

Ok, i think i can use last_items module with little changes to a mysql to show best selling products in frontpage of the store.. If somebody can just give me help for changing mysql code?

I have done some changes but it doesn´t give me accurate answers.. ( It´s been 5 years since last mysql coding  :-P)

zirzy

Hi!
Yes, i wanna know how can i show best selling items to customers? Is this kind of snippet out yet? Or is it easy to build from older snippets?