Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Best seller icon

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-03-2011, 08:06 AM
  Phoenixone's Avatar 
Phoenixone Phoenixone is offline
 

Advanced Member
  
Join Date: Feb 2010
Location: Portugal
Posts: 38
 

Lightbulb 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?
__________________
PHP 5.2.11
MYSQL 5.0.45

WESH UK hosting

--- Add-ons -----
X-RMA
X-AOM
X-FancyCategories
X-Feature comparison

BCSE Request a Quote
BCSE Customer Testimonials
BCSE Advanced ratings and reviews
BCSE Customer reward points
BCSE Reward points refferal
BCSE Customer polls

Cart Labs - Tabs
Reply With Quote
  #2  
Old 02-08-2011, 06:13 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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}
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 03-10-2011, 10:38 PM
  Phoenixone's Avatar 
Phoenixone Phoenixone is offline
 

Advanced Member
  
Join Date: Feb 2010
Location: Portugal
Posts: 38
 

Default 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
__________________
PHP 5.2.11
MYSQL 5.0.45

WESH UK hosting

--- Add-ons -----
X-RMA
X-AOM
X-FancyCategories
X-Feature comparison

BCSE Request a Quote
BCSE Customer Testimonials
BCSE Advanced ratings and reviews
BCSE Customer reward points
BCSE Reward points refferal
BCSE Customer polls

Cart Labs - Tabs
Reply With Quote
  #4  
Old 03-11-2011, 09:16 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 03-12-2011, 01:14 AM
  Phoenixone's Avatar 
Phoenixone Phoenixone is offline
 

Advanced Member
  
Join Date: Feb 2010
Location: Portugal
Posts: 38
 

Talking 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
__________________
PHP 5.2.11
MYSQL 5.0.45

WESH UK hosting

--- Add-ons -----
X-RMA
X-AOM
X-FancyCategories
X-Feature comparison

BCSE Request a Quote
BCSE Customer Testimonials
BCSE Advanced ratings and reviews
BCSE Customer reward points
BCSE Reward points refferal
BCSE Customer polls

Cart Labs - Tabs
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:50 AM.

   

 
X-Cart forums © 2001-2020