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

Special Offers Module

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 09-29-2004, 07:56 PM
 
BHMedia BHMedia is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 71
 

Default

sweet
Reply With Quote
  #32  
Old 10-06-2004, 07:30 AM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default

Quote:
Originally Posted by enge919
Have any idea what to change in the script to get it to work properly with 4.0.3?

Change specials.php to this one:

Code:
<? # # $Id: specials.php by FS based on featured_products.php,v 1.2.2.3 2004/09/09 12:12:41 max Exp $ # specials mod idea by funkydunk # Get featured products data and store it into $specials array # if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); } # # select from products table # $membership = !empty($user_account['membership'])?$user_account['membership']:""; $f_cat = (empty ($cat) ? "0" : $cat); if ($config["General"]["unlimited_products"]=="N" && $config["General"]["disable_outofstock_products"]) $avail_condition = "($sql_tbl[products].avail>0 OR $sql_tbl[products].product_type='C') and "; else $avail_condition = ""; $query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[pricing].productid=$sql_tbl[products].productid AND price < list_price ORDER BY RAND() LIMIT 6 "; $specials = func_query($query); if(is_array($specials)){ foreach($specials as $f_v => $f_k){ $int_res = ''; if(is_array($f_k)){ if(!empty($active_modules['Product_Options'])) { $tmp_price = func_get_price_default_variant($specials[$f_v]['productid'], @$user_account['membership']); if ($tmp_price) $specials[$f_v]["price"] = $tmp_price; } # # Get thumbnail's URL (uses only if images stored in FS) # $specials[$f_v]["tmbn_url"] = func_get_thumbnail_url($specials[$f_v]["productid"]); # # Recalculate prices if VAT is enabled and prices do not includes VAT # $specials[$f_v]["taxes"] = func_get_product_taxes($specials[$f_v], $login); # # Check if product have product options # if(!empty($active_modules['Product_Options'])) { $specials[$f_v]["product_options"] = func_query_first_cell("SELECT COUNT(*) FROM $sql_tbl[classes] WHERE productid='".$f_k["productid"]."'"); } # # Replace descr and fulldescr on international (if defined) # $int_res = func_query_first("SELECT * FROM $sql_tbl[products_lng] WHERE code='$store_language' AND productid='".$f_k['productid']."'"); if (!empty($int_res["product"])) { $specials[$f_v]["product"] = stripslashes($int_res["product"]); } if (!empty($int_res["descr"])) { $specials[$f_v]["descr"] = str_replace("\n"," ", stripslashes($int_res["descr"])); } if (!empty($int_res["full_descr"])) { $specials[$f_v]["fulldescr"] = str_replace("\n"," ", stripslashes($int_res["full_descr"])); } if ($specials[$f_v]["descr"] == strip_tags($specials[$f_v]["descr"])) $specials[$f_v]["descr"] = str_replace("\n", " ", $specials[$f_v]["descr"]); if ($specials[$f_v]["fulldescr"] == strip_tags($specials[$f_v]["fulldescr"])) $specials[$f_v]["fulldescr"] = str_replace("\n", " ", $specials[$f_v]["fulldescr"]); } } }; if (!empty($active_modules["Subscriptions"])) { include_once $xcart_dir."/modules/Subscriptions/subscription.php"; } $smarty->assign("specials",$specials); ?>

Example: http://www.shopping-carts-upgrades.com/

__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #33  
Old 07-02-2005, 07:38 AM
 
Online Michael Online Michael is offline
 

eXpert
  
Join Date: Mar 2005
Location: Melbourne, Australia
Posts: 273
 

Default

Quote:
Originally Posted by shan
Anyone created this as a side menu like the bestsellers has ?

Your wish is my command.... Here is the code:

Replace the entire code in the specials.tpl with this:

Code:
{* $Id: specials.tpl,v 1.3.2.1 2004/11/16 11:15:01 max Exp $ *} {if $specials ne ""} {capture name=specials} <TABLE cellpadding="0" cellspacing="2" border="0"> {section name=num loop=$specials} <TR> <TD width="30"> {include file="product_thumbnail.tpl" productid=$specials[num].productid image_x=25 product=$specials[num].product} </TD> <TD> {$specials[num].product} <S>{include file="currency.tpl" value=$specials[num].list_price}</S> Now:{include file="currency.tpl" value=$specials[num].price} </TD> </TR> {/section} </TABLE> {/capture} {include file="menu.tpl" menu_title= "Hot Specials" menu_content=$smarty.capture.specials extra="width=100%"} {/if}

Insert the following line of code where ever you want the specials to appear in the skin1/customer/home.tpl file:

Code:
{include file="customer/main/specials.tpl"}

That's about it...enjoy

Oh, and btw, this works fine on 4.0.13
__________________
X-Cart 5.3.5.4
Reply With Quote
  #34  
Old 07-13-2005, 04:02 PM
 
torola torola is offline
 

Advanced Member
  
Join Date: Feb 2005
Location: Toronto, Canada
Posts: 54
 

Default

Hello,

I am kind of lost here, can somone please recap and put all mods together, and show final instructions exactly what needs to be done to get this mod to be working.

Thanks you,
__________________
Unix X-Cart PRO 4.0.12
Add-on: X-Affiliate
Reply With Quote
  #35  
Old 07-14-2005, 06:26 AM
 
torola torola is offline
 

Advanced Member
  
Join Date: Feb 2005
Location: Toronto, Canada
Posts: 54
 

Default

Hi, me again I figured it out, its working, great!

However is there a way to select a category or categories from which you only want to show the discouted products in the "Hot specials" list?

I mean I have 10 categories, but I only want to show products from 3 of them in the "Hot specials" list.

Thanks
Tom
__________________
Unix X-Cart PRO 4.0.12
Add-on: X-Affiliate
Reply With Quote
  #36  
Old 10-07-2005, 09:12 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,471
 

Default

Hello ..

Will this mod work with v4.0.15 ?

Thanks & Regards

:sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #37  
Old 10-09-2005, 05:00 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,471
 

Default

Quote:
Originally Posted by chamberinternet
Will this mod work with v4.0.15 ?

Yup ... seems to ...

:sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #38  
Old 10-17-2005, 12:35 PM
 
yages yages is offline
 

eXpert
  
Join Date: Sep 2004
Location: Australia
Posts: 332
 

Default

How do you limit this mod to to show only one category
__________________
yages
x-cart version 4.5.5
Reply With Quote
  #39  
Old 10-17-2005, 05:00 PM
 
Online Michael Online Michael is offline
 

eXpert
  
Join Date: Mar 2005
Location: Melbourne, Australia
Posts: 273
 

Default

yages,

check out this Clearance mod if you just want one category limit:

http://forum.x-cart.com/viewtopic.php?t=20781&highlight=
Hope this helps
__________________
X-Cart 5.3.5.4
Reply With Quote
  #40  
Old 11-13-2005, 06:31 PM
 
micromedia micromedia is offline
 

Member
  
Join Date: Feb 2005
Posts: 27
 

Default

Hello,

I am kind of lost here, can somone please recap and put all mods together, and show final instructions exactly what needs to be done to get this mod to be working.

Thanks you,
__________________
X Cart Gold Ver. 4.1.6
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 02:15 PM.

   

 
X-Cart forums © 2001-2020