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

Splash message on Products list

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-29-2009, 01:15 AM
 
Tony Pearce Tony Pearce is offline
 

eXpert
  
Join Date: Apr 2004
Location: Totnes, Devon, UK
Posts: 217
 

Default Splash message on Products list

Mod to show 'Splash' on products list (column display only)

Very easy

Works with 4.1.9 - 4.1.12, others not tested but may work.

NO LIABILITY accepted for any mistakes or your inability to BACKUP before starting this...

This is using mods already developed by others but used in a different way to add an extra promotion 'Splash' to a product

So I do not pass this code off as my own and acknowledge all those who developed the original.

Start (Backup!)

Insert this code into 'products.php' (home directory of X-Cart):

if (!empty($active_modules["Extra_Fields"]) && !empty($products)) {
foreach($products as $k => $v) {
$products[$k]["extra_fields"] = func_query("SELECT $sql_tbl[extra_fields].field as field, $sql_tbl[extra_field_values].value as value, $sql_tbl[extra_fields].service_name as service_name FROM $sql_tbl[extra_fields], $sql_tbl[extra_field_values] WHERE $sql_tbl[extra_field_values].fieldid = $sql_tbl[extra_fields].fieldid AND $sql_tbl[extra_fields].active='Y' AND $sql_tbl[extra_field_values].productid = '$v[productid]'");
}
}

before the following line:

$smarty->assign("products",$products);


Insert this code into 'skin1/customer/main/products_t.tpl'

{foreach from=$products[product].extra_fields item="ef"}
{if $ef.value ne '' && $ef.service_name eq 'SERVICE_NAME06'}
</ br><br>
<span class="star">{$ef.value}</span><br><br>
{/if}
{/foreach}

Just AFTER:

{if $config.Appearance.display_productcode_in_list eq "Y" and $products[product].productcode ne ""}
{$lng.lbl_sku}: {$products[product].productcode}<br />
{/if}

Go to 'Extra Fields' in your X-Cart admin and add a new extra field called 'Promotion' and call the service name 'SERVICE_NAME06' (if you have already used this us a new one but change the reference in the code inserted into 'skin1/customer/main/products_t.tpl')


Add to 'style1.css':

.star {
font-family: Georgia, "Times New Roman", Times, serif;
color: #F00;
border: thin dotted #999;
background-color: #FFF;
width: auto;
padding-top: 2px;
padding-right: 6px;
padding-bottom: 2px;
padding-left: 6px;
font-size: 16px;
font-weight: bold;
}

edit this to suit your store design.



Now add a promotional message to show above a product i.e. '* Reduced *' and this will show just below the title, to see an example go to:

http://www.campinguniverse.co.uk/

and look in featured products.


All very simple but we have found this a good way to push certain products, and of course you can use this for any message, 'Last few' 'New version' etc etc
__________________
X Cart version 4.1.9, 4.1.10, 4.1.11, 4.1.12
(Looking after 15 stores)
Just started 4.4.1 for client....
One Page Checkout, On-Sale, Dynamic Images ++++ Loads of others.
+ 2 Multi Domain stores on 4.1.9
Reply With Quote
  #2  
Old 05-29-2009, 04:24 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Splash message on Products list

Very nice!

I believe starting with 4.1 Extra Fields are already available so you don't need to get them in products.php.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 01:41 AM.

   

 
X-Cart forums © 2001-2020