X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Special Offers Module (https://forum.x-cart.com/showthread.php?t=1144)

jgkiefer 06-16-2003 05:59 AM

Quote:

Originally Posted by funkydunk
Shan,

Yep - Am building a site at the moment with this in a lhs menu.

Limited it to show 3 products though cos of space.


How is this coming along?

funkydunk 06-16-2003 06:40 AM

This has been done.

lhs menu shows a selection of three products that have a discount applied then a link to a special offers page that lists all products with the normal navigation through the pages.

jgkiefer 06-16-2003 07:03 AM

How much is 120L in dollars?

funkydunk 06-16-2003 07:28 AM

120 what?

jgkiefer 06-16-2003 11:11 AM

Your site says that that mod costs 120L.

funkydunk 06-16-2003 11:42 AM

sorry - you lost me then... the L is actually a бё GBP

if you pm me I can confirm details of costings etc.

enge919 05-29-2004 04:40 AM

Does anyone know if this works in 3.5.x?

I need this for a client with 3.5.4 but we want to modify it to just randomly pull 6 items from the database to display without being dependent on the item being marked down. In other word he does not show marked down items but want the home page to always be fresh.

UPDATED: See my fix below to use this with or without discounted products in 3.5.x!

jeeya 05-29-2004 04:19 PM

I am getting this error after I add - specials.php in home.php



INVALID SQL: 1054 : Unknown column 'discount' in 'where clause'
SQL QUERY FAILURE: SELECT * FROM xcart_products,xcart_pricing WHERE forsale='Y' AND avail>0 AND xcart_products.productid=xcart_pricing.productid AND discount > 0 ORDER BY RAND() LIMIT 6


Version 3.4.0

enge919 05-30-2004 12:37 AM

just change the following code in specials.php

Code:

<?

// the database query
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid AND discount > 0 ORDER BY RAND() LIMIT 6 ";

// give the product array to smarty to make it available sitewide.
$specials = func_query($query);
$smarty->assign("specials",$specials);
?>


to

Code:

<?

// the database query
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid ORDER BY RAND() LIMIT 6 ";

// give the product array to smarty to make it available sitewide.
$specials = func_query($query);
$smarty->assign("specials",$specials);
?>


This will just randomly pull products from the database regardless of any discounts.

And if you only want to show products you have discounted from the list price use this:

Code:

<?

// the database query
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid AND price < list_price ORDER BY RAND() LIMIT 4 ";

// give the product array to smarty to make it available sitewide.
$specials = func_query($query);
$smarty->assign("specials",$specials);
?>


Change LIMIT 6 to any number of products you want to show in the specials.tpl

Also be sure to name the specials template specials.tpl. I noticed in the original code it was named special.tpl.

I have tested this in 3.5.4 and works like a charm :D

hth

jeeya 05-30-2004 02:27 AM

Great Thanks Works Perfect.

Also Is there anyway to modify this to be shown on help section page - like about us page.


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

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