WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Is there bestsellers snippet yet?
  • Print
Pages: [1]   Go Down

Author Topic: Is there bestsellers snippet yet?  (Read 22467 times)

Offline zirzy

  • Posts: 178
Is there bestsellers snippet yet?
« on: July 18, 2011, 07:59:44 PM »
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?
Logged

Offline zirzy

  • Posts: 178
Re: Is there bestsellers snippet yet?
« Reply #1 on: October 15, 2011, 12:07:25 PM »
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)
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #2 on: November 01, 2011, 08:08:00 PM »
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
Logged

Offline zirzy

  • Posts: 178
Re: Is there bestsellers snippet yet?
« Reply #3 on: November 02, 2011, 09:09:42 AM »
Hi Bug,

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

Offline dbs

  • Betatester
  • **
  • Posts: 8914
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Is there bestsellers snippet yet?
« Reply #4 on: November 02, 2011, 09:15:12 AM »
Quote
I´m looking forward to this
me too  :wink:
Logged
https://onkel-franky.de

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #5 on: November 02, 2011, 07:32:35 PM »
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...
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #6 on: November 02, 2011, 09:19:23 PM »
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
« Last Edit: November 02, 2011, 10:06:29 PM by Bug »
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #7 on: November 02, 2011, 09:25:33 PM »
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

Code: [Select]
$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
Code: [Select]
$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]
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #8 on: November 02, 2011, 09:27:26 PM »
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 ...

« Last Edit: November 02, 2011, 10:23:13 PM by Bug »
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #9 on: November 02, 2011, 09:54:48 PM »
last step:

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


Code: [Select]
$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]
« Last Edit: November 02, 2011, 10:07:40 PM by Bug »
Logged

Offline zirzy

  • Posts: 178
Re: Is there bestsellers snippet yet?
« Reply #10 on: November 03, 2011, 08:53:01 AM »
How nice is that! :) Thank you Bug! I have to test this as soon as possible (now i have to work).

Thanks again!! ;)
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #11 on: November 03, 2011, 05:42:49 PM »
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 ...


Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #12 on: November 04, 2011, 05:37:11 PM »
@ zirzy:
Freesbee responded positive and with any luck the bestsellersfunction and snippet can be a standard thing in the near future ...
Logged

Offline zirzy

  • Posts: 178
Re: Is there bestsellers snippet yet?
« Reply #13 on: November 05, 2011, 03:17:58 PM »
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 :)
Logged

Offline zirzy

  • Posts: 178
Re: Is there bestsellers snippet yet?
« Reply #14 on: November 05, 2011, 05:29:40 PM »
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?
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #15 on: November 06, 2011, 01:17:59 PM »
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'
Logged

Offline zirzy

  • Posts: 178
Re: Is there bestsellers snippet yet?
« Reply #16 on: November 06, 2011, 07:27:25 PM »
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]
« Last Edit: November 06, 2011, 07:29:48 PM by zirzy »
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #17 on: November 07, 2011, 07:17:28 PM »
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....
Logged

Offline zirzy

  • Posts: 178
Re: Is there bestsellers snippet yet?
« Reply #18 on: November 08, 2011, 08:46:14 AM »
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 :)
Logged

Offline Bug

  • Posts: 237
Re: Is there bestsellers snippet yet?
« Reply #19 on: November 08, 2011, 01:48:29 PM »
working on that one ...

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

Offline dbs

  • Betatester
  • **
  • Posts: 8914
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Is there bestsellers snippet yet?
« Reply #20 on: November 08, 2011, 02:37:01 PM »
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.
« Last Edit: November 08, 2011, 02:40:25 PM by dbs »
Logged
https://onkel-franky.de

Offline seanie_morris

  • Posts: 301
  • Gender: Male
Re: Is there bestsellers snippet yet?
« Reply #21 on: February 02, 2017, 08:19:23 PM »
Was there any movement on this snippet? It would be a nice little addition...

Seanie.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Is there bestsellers snippet yet?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2