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

FREE SHIPPING mod based on order total.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 11-04-2004, 10:28 AM
 
mream mream is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 50
 

Default Enhancement to Free Shipping Mod

What I would like to see in addition to free shipping over x amount is something that would tell a visitor how much more they would need to spend to get to the free shipping threshold, and maybe even suggest some products to get them there?

Anyone know of anything like that? Is it even possible?

thanks,
__________________
Matt
X-Cart Gold 4.0.11
Apache 1.3.29 (Unix)
PHP 4.3.4
Reply With Quote
  #12  
Old 11-04-2004, 03:03 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default

Yes, it would be trivial to see if their current order total is less than the free shipping threshold and if so, display a message to the user. If you can figure out how to install this mod, you can probably figure out how to do what you're trying to do. I have no time to help at the moment though. Sorry.

Hint: It should require no more than two lines of code in the PHP file and 1 line of code in the template file to make this work. Just do the comparison in the PHP file and assign a smarty template variable to hold the result. Then in your template file add a line to check the result and display your message.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #13  
Old 11-04-2004, 03:51 PM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

Can't you just use a shipping band to do free shipping? That's how all of my clients do it.

You set up shipping bands like

Up to $40 charge $9.99 flat rate

Up to $1000000 charge 0.00 flat rate

So if the subtotal is great than $40 they get free shipping?

Just curious as to why you'd want to mod the cart for something it can do by standard unless (in which case excuse me please!) that I've completely missed the point of this mod above
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #14  
Old 11-08-2004, 09:13 AM
 
mream mream is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 50
 

Default

Thanks for the feedback.

Groovico, what I'm looking for is different than what is offered standard. I know I can do free shipping at a certain dollar level.

What I'm thinking of (and I wish I could find my example site!) is a message in the floating cart or somewhere that says "only $x.xx until you receive free shipping on the entire order. Click here to select products in that range." Then a page would be generated listing products just at or over the dollar amount specified.
__________________
Matt
X-Cart Gold 4.0.11
Apache 1.3.29 (Unix)
PHP 4.3.4
Reply With Quote
  #15  
Old 11-08-2004, 02:21 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

what groovico is saying is that x-cart does this mod as standard in ALL versions. He was not talking about the little bit of maths that you want to add in.

If you really want to do the maths bit - an easy way would be to add the following few lines to the cart.tpl template along the lines of:

{math equation=x-y x=$variable_with_limit_in y=$variable_with_cart_total assign=need_to_spend}

{if $need_to_spend gt 0}
spend some more dude
{else}
hurray - you've got free shipping
{/if}

the names of real variables have been changed to protect the innocent.
__________________
ex x-cart guru
Reply With Quote
  #16  
Old 11-08-2004, 04:28 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Quote:
Originally Posted by funkydunk
what groovico is saying is that x-cart does this mod as standard in ALL versions. He was not talking about the little bit of maths that you want to add in.

If you really want to do the maths bit - an easy way would be to add the following few lines to the cart.tpl template along the lines of:

{math equation=x-y x=$variable_with_limit_in y=$variable_with_cart_total assign=need_to_spend}

{if $need_to_spend gt 0}
spend some more dude
{else}
hurray - you've got free shipping
{/if}

the names of real variables have been changed to protect the innocent.
OMFG, FunkyDunk lives!
Reply With Quote
  #17  
Old 11-08-2004, 09:23 PM
 
mream mream is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 50
 

Default

Cool. Thanks for your help!
__________________
Matt
X-Cart Gold 4.0.11
Apache 1.3.29 (Unix)
PHP 4.3.4
Reply With Quote
  #18  
Old 11-08-2004, 11:38 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Quote:
Originally Posted by adpboss
Quote:
Originally Posted by funkydunk
what groovico is saying is that x-cart does this mod as standard in ALL versions. He was not talking about the little bit of maths that you want to add in.

If you really want to do the maths bit - an easy way would be to add the following few lines to the cart.tpl template along the lines of:

{math equation=x-y x=$variable_with_limit_in y=$variable_with_cart_total assign=need_to_spend}

{if $need_to_spend gt 0}
spend some more dude
{else}
hurray - you've got free shipping
{/if}

the names of real variables have been changed to protect the innocent.
OMFG, FunkyDunk lives!

rofl

yeah - can almost see daylight through the work
__________________
ex x-cart guru
Reply With Quote
  #19  
Old 11-15-2004, 07:22 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

A similar situation

Wanted free shipping for orders over 89.99 but used real time shipping methods to calculate shipping costs. you have to set up a manual shipping charge with proces threashold of 9999.99 with a price of zero

because you dont want to show the free shipping option to anyone under 90.00 and you dont have a manual shipping method set up you can use the following code.

this was done in a 3.5.12 site but would work the same in other versions im sure.

the only file that was modified is cart_totals.tpl

find this line (around line 20)

Code:
{if $shipping ne "" and $need_shipping}
and just after it add


Code:
{if $cart.discounted_subtotal gt 89.99} <font class=ProductPriceSmall>Congratulations, you qualify for Free Shipping</font> {else} <font class=ProductPriceSmall>Spend an extra {math equation="x - y" x=89.99 y=$cart.discounted_subtotal} to qualify for Free Shipping</font> {/if} <font class=FormButton>{$lng.lbl_delivery}: </font> <select name=shippingid onchange="document.cartform.submit()"> {section name=ship_num loop=$shipping} {if $shipping[ship_num].rate ne 0 or $cart.discounted_subtotal gt 89.99} <option value="{$shipping[ship_num].shippingid}" {if $shipping[ship_num].shippingid eq $cart.shippingid}selected{/if}>{$shipping[ship_num].shipping|escape}{if $config.Appearance.display_shipping_cost eq "Y" and ($login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if}</option> {/if} {/section} </select>

this mod also gives a message to say how much more you need to spend to get free shipping and then gives a message if you are allowd free shipping.

change the 89.99 to suit your own needs
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #20  
Old 11-16-2004, 05:26 PM
 
elitedimension elitedimension is offline
 

Senior Member
  
Join Date: Aug 2004
Posts: 112
 

Default

Quote:
Originally Posted by shan
A similar situation

Wanted free shipping for orders over 89.99 but used real time shipping methods to calculate shipping costs. you have to set up a manual shipping charge with proces threashold of 9999.99 with a price of zero

because you dont want to show the free shipping option to anyone under 90.00 and you dont have a manual shipping method set up you can use the following code.

this was done in a 3.5.12 site but would work the same in other versions im sure.

the only file that was modified is cart_totals.tpl

find this line (around line 20)

Code:
{if $shipping ne "" and $need_shipping}
and just after it add


Code:
{if $cart.discounted_subtotal gt 89.99} <font class=ProductPriceSmall>Congratulations, you qualify for Free Shipping</font> {else} <font class=ProductPriceSmall>Spend an extra {math equation="x - y" x=89.99 y=$cart.discounted_subtotal} to qualify for Free Shipping</font> {/if} <font class=FormButton>{$lng.lbl_delivery}: </font> <select name=shippingid onchange="document.cartform.submit()"> {section name=ship_num loop=$shipping} {if $shipping[ship_num].rate ne 0 or $cart.discounted_subtotal gt 89.99} <option value="{$shipping[ship_num].shippingid}" {if $shipping[ship_num].shippingid eq $cart.shippingid}selected{/if}>{$shipping[ship_num].shipping|escape}{if $config.Appearance.display_shipping_cost eq "Y" and ($login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if}</option> {/if} {/section} </select>

this mod also gives a message to say how much more you need to spend to get free shipping and then gives a message if you are allowd free shipping.

change the 89.99 to suit your own needs

How does this allow realtime shipping for all orders under $90? I think I'm not seeing something--too many late nights of coding Thanks.
__________________
X-Cart Gold 4.0.9
http://www.thecigarhumidor.com
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 06:42 AM.

   

 
X-Cart forums © 2001-2020