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

Free Gifts Module for x-cart v4.1.8

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 10-07-2007, 07:36 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Free Gifts Module for x-cart v4.1.8

I intended on adding this post to the end of the original thread located here.
But doing so may lead to confusion with the older v3.4 and v4.0 code of that thread.

First of all, giving credit where credit is due. Kudos to MonkeyClan, the original poster of this great Mod and to all those that contributed.

This module is basically the same as MonkeyClan's post but was modified for x-cart v4.1.8
As stated in the original post which was for x-cart v3.4.14 and v4.0.12, this module basically allows the store administrator to define "Free Gifts" that are offered to the customer if they spend a certain amount of money. This module also has the added feature called 'Notification Price' that tells the customer that if they spend $XX more, they'll get a free gift.

STEP 1
In the administrator side, we place a menu item called 'Free Gifts' in the Inventory menu under the 'Coupons' menu item.

Find the following line of code in skin1/provider/menu.tpl:
Code:
<a href="{$catalogs.provider}/coupons.php" class="VertMenuItems">{$lng.lbl_coupons}</a><br /> {/if}
and after that code, add:
Code:
<a href="{$catalogs.provider}/freegifts.php" class="VertMenuItems">{$lng.lbl_free_gifts}</a><br />
STEP 2
WARNING: always make a backup of your database before making any changes to it!
Now, using phpMyAdmin or any other way; create the 'x-cart_freegifts' table to your x-cart database.
Code:
CREATE TABLE `xcart_freegifts` ( `id` int(11) NOT NULL auto_increment, `productid` int(11) NOT NULL default '0', `minimum_price` decimal(12,2) NOT NULL default '0.00', `notification_price` decimal(12,2) default NULL, `active` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`) ) TYPE=MyISAM;
STEP 3
We now create a file by copying the following code, and saving it as xcart/include/func.php

Code:
<?php # # $Id: func.php,v 1.0 2007/10/06 svowl Exp $ # function func_get_free_gifts($onlyActive = false) { $query = "SELECT fg.id, fg.productid, p.product, fg.minimum_price, fg.notification_price, fg.active FROM xcart_freegifts fg LEFT JOIN xcart_products p ON fg.productid = p.productid"; if ($onlyActive) { $query .= " WHERE active = 1"; } $query .= " ORDER BY minimum_price"; $freeGifts = func_query($query); if (!is_array($freeGifts)) { $freeGifts = array(); } return $freeGifts; } function func_free_gift_of_price_exists($minimum_price) { $query = "SELECT id FROM xcart_freegifts WHERE minimum_price = " . $minimum_price; $freegift = func_query_first($query); return count($freegift); } function func_add_free_gift($productid, $minimum_price, $notification_price, $active) { $notificationPriceStr = ($notification_price) ? $notification_price : "NULL"; $query = "INSERT INTO xcart_freegifts (productid, minimum_price, notification_price, active) VALUES(" . $productid . ", " . $minimum_price . ", " . $notificationPriceStr . ", " . $active . ")"; db_query($query); return mysql_affected_rows(); } function func_activate_free_gift($id) { $query = "UPDATE xcart_freegifts SET active = 1 WHERE id = " . $id; db_query($query); return mysql_affected_rows(); } function func_deactivate_free_gift($id) { $query = "UPDATE xcart_freegifts SET active = 0 WHERE id = " . $id; db_query($query); return mysql_affected_rows(); } function func_update_free_gift_notification_price($id, $notification_price) { $notificationPriceStr = ($notification_price) ? $notification_price : "NULL"; $query = "UPDATE xcart_freegifts SET notification_price = " . $notificationPriceStr . " WHERE id = " . $id; db_query($query); return mysql_affected_rows(); } function func_product_exists_is_avail($productid) { $query = "SELECT * FROM xcart_products WHERE productid = " . $productid . " AND forsale = 'Y'"; return count(func_query_first($query)); } function func_free_gift_of_product_exists($productid) { $query = "SELECT id FROM xcart_freegifts WHERE productid = " . $productid; $freegift = func_query_first($query); return count($freegift); } function func_update_free_gift_price($id, $minimum_price) { $query = "UPDATE xcart_freegifts SET minimum_price = " . $minimum_price . " WHERE id = " . $id; db_query($query); return mysql_affected_rows(); } function func_delete_free_gift($id) { $query = "DELETE FROM xcart_freegifts WHERE id = " . $id; db_query($query); return mysql_affected_rows(); } function func_get_product_name($productid) { $query = "SELECT product FROM xcart_products WHERE productid = " . $productid; $product = func_query_first($query); return $product["product"]; } ?>
STEP 4
Now create another file for handling all the administration modifications to the Free Gifts by saving it as xcart/provider/freegifts.php
Code:
<?php # # $Id: freegifts.php,v 1.0 2007/10/06 svowl Exp $ # require "./auth.php"; require $xcart_dir."/include/security.php"; include $xcart_dir."/include/categories.php"; include $xcart_dir."/include/func.php"; $location[] = array(func_get_langvar_by_name("lbl_free_gifts"), ""); $actionMsg = ""; if ($mode == "add") { if (isset($fg_productid) && isset($fg_minimum_price) && ($fg_productid != "") && ($fg_minimum_price != "")) { if (func_product_exists_is_avail($fg_productid)) { if (!func_free_gift_of_product_exists($fg_productid)) { $minimumPrice = floatval($fg_minimum_price); $notificationPrice = ($fg_notification_price) ? floatval($fg_notification_price) : ""; if (!func_free_gift_of_price_exists($minimumPrice)) { if ($minimumPrice > 0) { if (($notificationPrice == "") || ($notificationPrice < $minimumPrice)) { $active = (isset($fg_active) && ($fg_active == "1")) ? "1" : "0"; func_add_free_gift($fg_productid, $minimumPrice, $notificationPrice, $active); } else { $actionMsg = "The notification price must be less than the minimum price."; } } else { $actionMsg = "The minimum price is invalid."; } } else { $actionMsg = "That minimum price has already been used."; } } else { $actionMsg = "That product has already been used."; } } else { $actionMsg = "Product does not exist or is not available for sale."; } } } else if ($mode == "delete") { if (isset($fg_id) && ($fg_id != "")) { func_delete_free_gift($fg_id); } } else if ($mode == "update") { if (isset($fg_id) && ($fg_id != "")) { $minimumPriceVar = "fg_minimum_price_" . $fg_id; $oldMinimumPriceVar = "fg_old_minimum_price_" . $fg_id; $notificationPriceVar = "fg_notification_price_" . $fg_id; $activeVar = "fg_active_" . $fg_id; if ($$minimumPriceVar != $$oldMinimumPriceVar) { if (isset($$minimumPriceVar) && ($$minimumPriceVar != "")) { $minimumPrice = floatval($$minimumPriceVar); if (!func_free_gift_of_price_exists($minimumPrice)) { if ($minimumPrice > 0) { func_update_free_gift_minimum_price($fg_id, $minimumPrice); } else { $actionMsg = "The minimum price is invalid."; } } else { $actionMsg = "That minimum price has already been used."; } } else { $actionMsg = "The minimum price is invalid."; } } if (isset($$notificationPriceVar)) { $notificationPrice = ($$notificationPriceVar) ? floatval($$notificationPriceVar) : ""; func_update_free_gift_notification_price($fg_id, $notificationPrice); } if (isset($$activeVar) && ($$activeVar == "1")) { func_activate_free_gift($fg_id); } else { func_deactivate_free_gift($fg_id); } } } $freegifts = func_get_free_gifts(); $smarty->assign("freegifts",$freegifts); $smarty->assign("freegifts_actionmsg",$actionMsg); $smarty->assign("main","freegifts"); # Assign the current location line $smarty->assign("location", $location); @include $xcart_dir."/modules/gold_display.php"; func_display("provider/home.tpl",$smarty); ?>

STEP 5
Now open the file skin1/single/home.tpl and find the following line of code
Code:
{elseif $main eq "coupons"} {include file="modules/Discount_Coupons/coupons.tpl"}
and add the following code after it:
Code:
{elseif $main eq "freegifts"} {include file="provider/main/freegifts.tpl"}

contiued on next post...
__________________
X-CART Gold v4.1.8
Reply With Quote
  #2  
Old 10-07-2007, 08:06 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Re: Free Gifts Module for x-cart v4.1.8

...continued from previous post

STEP 6a
Create another file by using the code below and saving it as skin1/provider/main/freegifts.tpl
Code:
{* $Id: freegifts.tpl,v 1.0 2007/10/06 svowl Exp $ *} {include file="page_title.tpl" title=$lng.lbl_free_gifts} {$lng.txt_freegifts_note} {capture name=dialog} <table border="0"> {if $freegifts_actionmsg ne ""} <tr><td colspan=5 class=AdminTitle>{$freegifts_actionmsg}</td></tr> <tr><td colspan=5></td></tr> {/if} <form action="freegifts.php" method="POST"> <input type=hidden name="mode" value="add"> <input type=hidden name="fg_id" value=""> <tr class=TableHead><TD>Active</TD><td>Product ID</td><td>Minimum Price</td><td>Notification Price</td><td></td></tr> {section name=whichFreeGift loop=$freegifts} <input type=hidden name="fg_old_minimum_price_{$freegifts[whichFreeGift].id}" value="{$freegifts[whichFreeGift].minimum_price}"> <tr> <td align=center><input type=checkbox name="fg_active_{$freegifts[whichFreeGift].id}" value=1{if $freegifts[whichFreeGift].active eq 1} checked{/if}></td> <td>{$freegifts[whichFreeGift].productid} ({$freegifts[whichFreeGift].product})</td> <td><input type=text name="fg_minimum_price_{$freegifts[whichFreeGift].id}" size=10 value="{$freegifts[whichFreeGift].minimum_price}"></td> <td><input type=text name="fg_notification_price_{$freegifts[whichFreeGift].id}" size=10 value="{$freegifts[whichFreeGift].notification_price}"></td> <td> <input type="button" value="Update" onClick="this.form.mode.value='update'; this.form.fg_id.value='{$freegifts[whichFreeGift].id}'; this.form.submit();"> <input type="button" value="Delete" onClick="this.form.mode.value='delete'; this.form.fg_id.value='{$freegifts[whichFreeGift].id}'; this.form.submit();"> </td> </tr> {/section} {if $smarty.section.whichFreeGift.total} <tr><td colspan=5></td></tr> {/if} <tr><td colspan=5 class=AdminTitle>Add a new Free Gift</td></tr> <tr> <td align=center><input type=checkbox name="fg_active" value=1></td> <td><input type=text name=fg_productid size=10 value=""></td> <td><input type=text name=fg_minimum_price size=10 value="0.00"></td> <td><input type=text name=fg_notification_price size=10 value=""></td> <td><input type="submit" value="Add Free Gift"></td> </tr> </form> </table> {/capture} {include file="dialog.tpl" title="EDIT FREE GIFTS" content=$smarty.capture.dialog extra="width=100%"}
STEP 6b
Go to Languages in the administration area and create two language variables.
Create a label variable and name it:

lbl_free_gifts and the content as:
Code:
Free gifts
and the other a text variable and name it:

txt_freegifts_note and the content as:

Code:
This page allows you to define free gifts that will be offered to customers if they spend a minimum amount that you specify. The free gifts should have their price set to 0 and be available for sale but should not be accessible via normal browsing of the site. <br><br> When a customer spends equal to or more than the minimum amount they will be notified of the promotion and will need to click on the link provided to add the item to their cart. If they remove items from their cart such that the cart total drops below the minimum price the item will be removed from their cart. <br><br>
END OF FREE GIFT ADMINISTRATION CODE

This takes care of the code required for the administration area.
It is a good idea now to test this part of the code to make sure that no mistakes were made and to add a couple of products to the Free gifts module.
Just click on the 'Free gifts' menu item under the 'Inventory' menu to see what it looks like.
If you don't see the 'Free gifts' menu item then just type cleanup.php in the address bar and the menu item will show up.
Before I added a product to the Free Gifts module I created a new category in the 'Categories' area and named it 'Free Gifts'. I then clicked NO on the dropdown on the very right were it says 'Enabled'. This prevents the Free Gift category from being displayed in the storefront.
Then I went to the product menu and set the price to 0 for the free gift and changed the main category to 'Free gifts'.
And from there I went to the Free Gifts module and added the product.
You can see what the product id is by hovering your cursor over the product hyperlink and you can see the product id on the bottom of the screen in the information bar. Or you can click on the product link and you can see the product id at the top on your address bar.

continued on next post...
__________________
X-CART Gold v4.1.8
Reply With Quote

The following user thanks MoonDog for this useful post:
gary02140 (06-02-2009)
  #3  
Old 10-07-2007, 09:06 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Re: Free Gifts Module for x-cart v4.1.8

...continued from previous post


Now we continue to do the coding for the customer side.

STEP 7
This is the promotion text and adjust the text if needed for your site design.
This text will show up in your 'view cart' page below the checkout button when you have an item in your cart.
Open the file skin1/customer/main/cart.tpl and find:
Code:
{else} {include file="buttons/button.tpl" button_title=$lng.lbl_checkout style="button" href="cart.php?mode=checkout"} {/if} </td> </tr>
and add the following code after it:
Code:
{section name=nfg loop=$notifyFreeGifts} {if $smarty.section.nfg.index eq 0} {/if} <tr><td align="center" colspan="2"><hr size="1" noshade="noshade" /> Spend ${$notifyFreeGifts[nfg].spend_more_amount} more and get a free {$notifyFreeGifts[nfg].product}! {/section} {section name=ofg loop=$offerFreeGifts} {if $smarty.section.ofg.index eq 0} <tr><td align="center" colspan="2"><hr size="1" noshade="noshade" /> Congratulations! You qualify for {if $smarty.section.ofg.total > 1}some{else}a{/if} free promotion{if $smarty.section.ofg.total > 1}s{/if}.{if $smarty.section.ofg.total > 1} To claim your free gifts, please choose from:{/if} {/if} Your subtotal is ${$offerFreeGifts[ofg].minimum_price} or more. To receive a free {$offerFreeGifts[ofg].product}, <a href="product.php?productid={$offerFreeGifts[ofg].productid}"><span style="color:#0000FF;">click here</span></a> {/section} </td></tr>
STEP 8
Add the following code to xcart/cart.php
near the top of the file find the line
Code:
require "./auth.php";


and add the following code after the line
Code:
include $xcart_dir."/include/func.php";
Now find the line of code
Code:
$intershipper_recalc = "Y";
and after this line add
Code:
# # GET ACTIVE FREE GIFTS # $activeFreeGifts = func_get_free_gifts(true); # # UPDATE CART BASED ON FREE GIFTS # $offerFreeGifts = array(); $notifyFreeGifts = array(); foreach ($activeFreeGifts as $freeGift) { $foundFreeGift = false; if ($freeGift["minimum_price"] > $cart["total_cost"]) { if (isset($cart["products"]) && is_array($cart["products"])) { foreach ($cart["products"] as $checkFreeGiftProduct) { if ($checkFreeGiftProduct["productid"] == $freeGift["productid"]) { $foundFreeGift = true; } } } if ($foundFreeGift) { // Remove free gift $tempProducts = array(); foreach ($cart["products"] as $checkProductForRemove) { if ($checkProductForRemove["productid"] != $freeGift["productid"]) { $tempProducts[] = $checkProductForRemove; } } $cart["products"] = $tempProducts; func_header_location("cart.php"); } else if ($freeGift["notification_price"] && ($freeGift["notification_price"] <= $cart["total_cost"])) { // Notify of the free gift $notifyFreeGifts[] = array("notification_price" => $freeGift["notification_price"], "spend_more_amount" => sprintf("%0.2f", ($freeGift["minimum_price"] - $cart["total_cost"])), "productid" => $freeGift["productid"], "product" => func_get_product_name($freeGift["productid"])); } } else { foreach ($cart["products"] as $checkFreeGiftProduct) { if ($checkFreeGiftProduct["productid"] == $freeGift["productid"]) { $foundFreeGift = true; } } if (!$foundFreeGift) { // Offer the free gift $offerFreeGifts[] = array("minimum_price" => $freeGift["minimum_price"], "productid" => $freeGift["productid"], "product" => func_get_product_name($freeGift["productid"])); } } }
now find this line of code
Code:
$smarty->assign("cart",$cart); }
and after the brace symbol } add the following code
Code:
# # UPDATE CART BASED ON FREE GIFTS # $offerFreeGifts = array(); $notifyFreeGifts = array(); foreach ($activeFreeGifts as $freeGift) { $foundFreeGift = false; if ($freeGift["minimum_price"] > $cart["total_cost"]) { if (isset($cart["products"]) && is_array($cart["products"])) { foreach ($cart["products"] as $checkFreeGiftProduct) { if ($checkFreeGiftProduct["productid"] == $freeGift["productid"]) { $foundFreeGift = true; } } } if ($foundFreeGift) { // Remove free gift $tempProducts = array(); foreach ($cart["products"] as $checkProductForRemove) { if ($checkProductForRemove["productid"] != $freeGift["productid"]) { $tempProducts[] = $checkProductForRemove; } } $cart["products"] = $tempProducts; func_header_location("cart.php"); } else if ($freeGift["notification_price"] && ($freeGift["notification_price"] <= $cart["total_cost"])) { // Notify of the free gift $notifyFreeGifts[] = array("notification_price" => $freeGift["notification_price"], "spend_more_amount" => sprintf("%0.2f", ($freeGift["minimum_price"] - $cart["total_cost"])), "productid" => $freeGift["productid"], "product" => func_get_product_name($freeGift["productid"])); } } else { foreach ($cart["products"] as $checkFreeGiftProduct) { if ($checkFreeGiftProduct["productid"] == $freeGift["productid"]) { $foundFreeGift = true; } } if (!$foundFreeGift) { // Offer the free gift $offerFreeGifts[] = array("minimum_price" => $freeGift["minimum_price"], "productid" => $freeGift["productid"], "product" => func_get_product_name($freeGift["productid"])); } } } $smarty->assign("activeFreeGifts", $activeFreeGifts); $smarty->assign("offerFreeGifts", $offerFreeGifts); $smarty->assign("notifyFreeGifts", $notifyFreeGifts);
STEP 9
Changes need to be made to skin1/customer/main/product.tpl to show the word FREE! instead of a text input field when the price is 0.00.
Find the line of code:

Code:
{if $product.taxed_price ne 0 || $variant_price_no_empty}
and replace it with
Code:
{if $product.taxed_price eq 0} <font class="ProductDetailsTitle">FREE!</font> {elseif $product.taxed_price ne 0 || $variant_price_no_empty}
Now find the line of code
Code:
{if $product.distribution eq "" and !($active_modules.Subscriptions ne "" and $subscription)}
and add this code after it
Code:
{if $product.taxed_price eq 0} <font class="ProductDetailsTitle">1</font><INPUT type="hidden" name="amount" value="1"> {else}
and also find this line
Code:
</select>
and add this code after it
Code:
{/if}

continued on next post...
__________________
X-CART Gold v4.1.8
Reply With Quote
  #4  
Old 10-07-2007, 09:20 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Re: Free Gifts Module for x-cart v4.1.8

...continued from previous post

STEP 10
To make sure that the quantity input field doesn't show up if it's a free gift, we have to modify the skin1/customer/main/cart.tpl file
findthis code
Code:
<font class="ProductPriceConverting">{include file="currency.tpl" value=$price} x {if $active_modules.Egoods and $products[product].distribution}1<input type="hidden"{else}<input type="text" size="3"{/if} name="productindexes[{$products[product].cartid}]" value="{$products[product].amount}" /> = </font><font class="ProductPrice">{math equation="price*amount" price=$price amount=$products[product].amount format="%.2f" assign=unformatted}{include file="currency.tpl" value=$unformatted}</font><font class="MarketPrice"> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$unformatted}</font>
and replace with
Code:
{assign var="isFreeGift" value="0"} {section name=afg loop=$activeFreeGifts} {if $activeFreeGifts[afg].productid eq $products[product].productid} {assign var="isFreeGift" value="1"} {/if} {/section} {if $isFreeGift eq "1"} <font class="ProductDetailsTitle">1 - FREE!</font> {else} <font class="ProductPriceConverting">{include file="currency.tpl" value=$price} x {if $active_modules.Egoods and $products[product].distribution}1<input type="hidden"{else}<input type="text" size="3"{/if} name="productindexes[{$products[product].cartid}]" value="{$products[product].amount}" /> = </font><font class="ProductPrice">{math equation="price*amount" price=$price amount=$products[product].amount format="%.2f" assign=unformatted}{include file="currency.tpl" value=$unformatted}</font><font class="MarketPrice"> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$unformatted}</font> {/if}

END OF CODE

Whew....And that's it.

The last couple of days I started playing around with this code with no intentions of actually completing this project. But I got so involved in implementing this code for x-cart v4.1.8 I decided to complete all original 10 steps of the original post. This modification of mine is by no means complete. It's a starting point for others to continue adding, deleting or modifying. Although I have tested it and it's working great and have found no problems, I'm sure that many more things can be done to improve this mod for v4.1.8

Have fun.

- MoonDog -
__________________
X-CART Gold v4.1.8
Reply With Quote
  #5  
Old 10-07-2007, 10:07 PM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Free Gifts Module for x-cart v4.1.8

Wow - I can't wait to try this later - just what we needed - thanks for sharing your code and all of your hard work.
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #6  
Old 10-08-2007, 06:18 AM
  DataViking's Avatar 
DataViking DataViking is offline
 

eXpert
  
Join Date: Jan 2003
Location: Las Vegas, NV
Posts: 361
 

Default Re: Free Gifts Module for x-cart v4.1.8

thank you I will try it also
__________________
Web Design Web Design and Custom X-Cart Projects

http://www.dataviking.com

Mention the forums for discounts!
x-cart Version 4.1.8
Reply With Quote
  #7  
Old 10-08-2007, 10:22 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Re: Free Gifts Module for x-cart v4.1.8

I edited the very last line of step 9.
It it correct now and should only have the {/if} statement.

I inadvertently had some javascript placed at the end of step 9 that should not be there.

- MoonDog -
__________________
X-CART Gold v4.1.8
Reply With Quote
  #8  
Old 10-11-2007, 09:39 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Free Gifts Module for x-cart v4.1.8

This works great apart from 1 error 1 get when changing a minimum price on the free gift item.

If you change the price and hit update I get the following error

Fatal error: Call to undefined function: func_update_free_gift_minimum_price() in /home/website/public_html/provider/freegifts.php on line 53

Any ideas?
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #9  
Old 10-11-2007, 09:59 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default Re: Free Gifts Module for x-cart v4.1.8

Another problem I get is that the part of the system that is supposed to say "spend another ёx to receive a free gift" does not work on my site.

Apart from that works just fine.
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #10  
Old 10-11-2007, 07:03 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Re: Free Gifts Module for x-cart v4.1.8

01bodyjewellery,

In xcart/provider/freegifts.php find this line:

Code:
func_update_free_gift_minimum_price($fg_id, $minimumPrice);

and modify by removing '_minimum' from this line of code.
It should look like this:
Code:
func_update_free_gift_price($fg_id, $minimumPrice);
Sorry, my mistake.

Quote:

Another problem I get is that the part of the system that is supposed to say "spend another ёx to receive a free gift" does not work on my site.

Apart from that works just fine.
In the admin area, make sure that your 'notification price' is less than the 'minimum price'. Hope this helps.

- MoonDog -
__________________
X-CART Gold v4.1.8
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:46 PM.

   

 
X-Cart forums © 2001-2020