X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Best seller icon (https://forum.x-cart.com/showthread.php?t=57890)

Phoenixone 02-03-2011 08:06 AM

Best seller icon
 
hi everyone,

i would like to indicate on a product that it is a best seller with say a Hot icon or some sort of image.

how would one go about doing so?

instead of listing the best sellers have an icon bu the products title

does anyone have any ideas?

qualiteam 02-08-2011 06:13 AM

Re: Best seller icon
 
You can create e.g. a Smarty modifier that will return the necessary HTML code when product is a Bestseller and further use it in the templates like this:

Code:

{$product.productid|is_bestseller}

Phoenixone 03-10-2011 10:38 PM

Re: Best seller icon
 
Quote:

Originally Posted by qualiteam
You can create e.g. a Smarty modifier that will return the necessary HTML code when product is a Bestseller and further use it in the templates like this:

Code:

{$product.productid|is_bestseller}


hi i tried to put this next to the product title and it didnt work

Code:

{if $product.productid|is_bestseller}
                    Image here
                    {/if}


nothing shows up, and it breaks my template

im using 4.2.2

qualiteam 03-11-2011 09:16 PM

Re: Best seller icon
 
You should create a smarty modifier before it can be used in templates.

Check this post http://forum.x-cart.com/showpost.php?p=309487&postcount=2

Note: It is only a sample of how to create your own modifier, not the exact one to be used for this very mod.

Phoenixone 03-12-2011 01:14 AM

Re: Best seller icon
 
ok i have figured this problem out:

my objective was to show a flame icon next to a products name if it was a bestseller.

well with enough tinkering and hair pulling it was quite simple,

i used this following piece of code wherever i want the icon to appear

in my case in the products_t.tpl

Code:

{if $product.views_stats > 1000}
<img src="(your image)" title="This Product is on FIRE!" />
{else}
{if $product.views_stats > 500}
<img src="(your image)" title="This is a HOT Product" />
{else}
{if $product.views_stats > 100}
<img src="(your image)" title="This is a Popular Product" />
{/if}
{/if}
{/if}

i used " product.views_stats " because my store is still new and i have not had major sales of specific goods.

so i decided to set it to how many times a product has been viewed.

if you want it to be for how many times a product has been sold use this:

product.sales_stats

you can have a look here:

Phoenix Tech - Widescreen LCD Monitors

this is a live store so no test purchases.

hope this helps anyone else out there that was looking for something similar


All times are GMT -8. The time now is 09:31 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.