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

Free Gifts Module

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 03-29-2006, 09:24 AM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

I've got this working on 4.18. Only step 10 gives me a hard time. The quantity box in cart displays no matter what.

there is also cart_details.tpl that needs step 10.
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #32  
Old 03-29-2006, 10:11 AM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

got it. I was comparing against product instead of prod_num
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #33  
Old 03-29-2006, 11:41 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

Guys I need some help please. All works perfect with the mod. However, when clicking on product.tpl to see and add free gift, I get a javascript error (does not affect anything though).

It tells me that 'avail' is undefined.

here is the problem line

Code:
if((mq > 0 && avail > mq) || is_unlimit == 'Y') avail = mq; // Update product quantity

and here is product.tpl on 4.18

Code:
{if $product.distribution eq "" and !($active_modules.Subscriptions ne "" and $subscription)} {if $product.taxed_price eq 0} <FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {else} {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = {$start_quantity|default:1}; var avail = {$mq|default:1}-1; var product_avail = {$product.avail|default:"0"}; </SCRIPT> <SELECT id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}> {section name=quantity loop=$mq start=$start_quantity} <OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION> {/section} </SELECT> {/if} {else} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = 1; var avail = 1; var product_avail = 1; </SCRIPT> <FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {if $product.distribution ne ""}{$lng.txt_product_downloadable}{/if}
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #34  
Old 03-29-2006, 11:57 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

ok, fixed. I also included the javascript in the added {if} condition
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #35  
Old 04-07-2006, 12:45 AM
 
MallRomania MallRomania is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 109
 

Default

Hello

Can somebody help me please? First, i get this error on admin area when i press update gift value: Fatal error: Call to undefined function: func_update_free_gift_minimum_price() in c:\inetpub\wwwroot\xcart\provider\freegifts.php on line 52


This function doesn't appear in this post as I can see...


Second: can somebody tell me how to use this module? My native language is not english so maybe i lost something. Why do I say that: i added all information, added free gift from admin (here is my question:

i have a product wich cost let's say 20 $...i want to give customers a free gift if they buy over this value so i added to admin->free gift:

Active Product ID Minimum Price Notification Price
checked 70 () 20 here doesn't appear any notification price even if i added 19


Also, my product.tpl look like this:

<TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</TD>
<TD valign="top">

{if $product.price ne 0}<font class=ProductDetailsTitle>{include file="currency.tpl" value=$product.price}</font>{else}<font class=ProductDetailsTitle>FREE!</font>{/if}


</TD>


If price is 0 a FREE message appear..if price is 20 no message appear...


Thank you
__________________
Mircea Teleleu
Shopedia.ro-la cumparaturi
www.shopedia.ro
______________________
x-cart gold 4.1.6
Linux
Reply With Quote
  #36  
Old 04-07-2006, 04:14 AM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

for number 1 you need to rename the function
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #37  
Old 04-07-2006, 07:33 AM
 
MallRomania MallRomania is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 109
 

Default

ok, first step solved, thanks Lionel.

Can somebody please send me full code for 4.0.18 gold at admin@mallromania.ro? Or there is any section from where i can download it? Don't see anything like that but i belive must be some way to take full code (download) with latest version of script in one pice without browsing pages after pages
__________________
Mircea Teleleu
Shopedia.ro-la cumparaturi
www.shopedia.ro
______________________
x-cart gold 4.1.6
Linux
Reply With Quote
  #38  
Old 04-10-2006, 10:41 PM
 
pcarcare pcarcare is offline
 

eXpert
  
Join Date: Jun 2004
Location: Salt Lake City, Utah
Posts: 230
 

Default

Very happy about this mod, however I can't get it working in 4.0.18.....

I am having a problem with the functions.

Quote:
Fatal error: Call to undefined function: func_product_exists_is_avail() in /MY_PATH/store/provider/freegifts.php on line 10
I see that I am missing that function, but I don't know how to write code at all. I tried to remove that line from freegifts.php but it made things worse. Can anybody list the functions added to func.php and php code for freegifts.php for use in 4.0.18?

Thanks
__________________
X-cart gold 4.5.2 (live)
X-payments 1.0.5

http://www.professionalcarcare.com
Your online source for all your car care needs
Reply With Quote
  #39  
Old 04-11-2006, 09:25 PM
 
pcarcare pcarcare is offline
 

eXpert
  
Join Date: Jun 2004
Location: Salt Lake City, Utah
Posts: 230
 

Default

I got the functions to work, but I am still having trouble with the last few steps. I can't get the product.tpl to display FREE instead of 0.00 and the txt insert box. I also don't understand how to remove the quantity option in version 4.0.18.

Any suggestions?
__________________
X-cart gold 4.5.2 (live)
X-payments 1.0.5

http://www.professionalcarcare.com
Your online source for all your car care needs
Reply With Quote
  #40  
Old 04-21-2006, 11:43 AM
 
MOC MOC is offline
 

Senior Member
  
Join Date: Oct 2002
Posts: 171
 

Default 3.5.14

Hi
i need help for this mod. I installed it for version 3.5.14!
I added the Free Gifts Link under Coupons in the Admin Menu. But if i click on FREE GIFTS, i get redirected to home.php

And i getting this error, when i waching cart.php
Code:
Warning: Invalid argument supplied for foreach() in /srv/www/htdocs/web2/html/shop/customer/cart.php on line 451


How can i fix it, what went wrong?

Thanks
Saskia
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 08:45 AM.

   

 
X-Cart forums © 2001-2020