11 messages in com.googlegroups.google-checkout-api-ukRe: [google-checkout-api-uk] Re: Roya...| From | Sent On | Attachments |
|---|---|---|
| Beast900 | 27 Jul 2007 03:00 | |
| Ropu | 27 Jul 2007 09:38 | |
| Antony Millar | 30 Jul 2007 03:56 | |
| Beast900 | 30 Jul 2007 10:17 | |
| Ropu | 30 Jul 2007 11:52 | |
| Beast900 | 31 Jul 2007 04:41 | |
| Ropu | 31 Jul 2007 08:37 | |
| Antony Millar | 31 Jul 2007 11:55 | |
| Ropu | 31 Jul 2007 13:34 | |
| Ropu | 31 Jul 2007 13:35 | |
| Antony Millar | 01 Aug 2007 02:15 |
| Subject: | Re: [google-checkout-api-uk] Re: Royal mail - UK - Any solution?![]() |
|---|---|
| From: | Ropu (rova...@gmail.com) |
| Date: | 07/31/2007 01:34:09 PM |
| List: | com.googlegroups.google-checkout-api-uk |
try this ///////////////////////////////////////////////////// Royal Mail 1st Class $total_weight = $cart->show_weight(); // $subtotal = $cart->show_total(); if(($total_weight <= 1.25)) { $shipname = "Royal Mail 1st Class"; if ($total_weight < 0.1) { $shipval = "2.18"; } else if (($total_weight > 0.1) && ($total_weight <= 0.25)) { $shipval = "2.47"; } else if (($total_weight > 0.25) && ($total_weight <= 0.5)) { $shipval = "3.12"; } else if (($total_weight > 0.5) && ($total_weight <= 0.75)) { $shipval = "3.65"; } else if (($total_weight > 0.75) && ($total_weight <= 1)) { $shipval = "4.29"; } else if (($total_weight > 1)) { $shipval = "7.35"; } $gcheck->push('flat-rate -shipping', array ('name' => $shipname)); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('flat-rate -shipping'); }
what basically says is that if the cart weight is more than 1.25 ignore the shipping
also moved the shipping name var to the top to avoid repeating code
this will be a solution that will be similar to the code u have been using
in next email a much more nicer a scalable solution
hope this helps
ropu On 7/31/07, Antony Millar <ant...@compushopdirect.com> wrote:
Hi Ropu,
Thanks again for your swift reply,
After much rookie code tinkering
I have it all sorted showing all methods,
However I can't seem to add the logic to say after 1.25kg do not show the options
else if (($total_weight > 1) && ($total_weight <= 1.25)) { $shipval = "7.75"; $shipname = "Royal Mail First Class Recorded Delivery"; }
What would I need to put after this?
Your help has been second to none
Regards
Antony ------------------------------
*From:* goog...@googlegroups.com [mailto: goog...@googlegroups.com] *On Behalf Of *Ropu *Sent:* 31 July 2007 16:38 *To:* goog...@googlegroups.com *Subject:* [google-checkout-api-uk] Re: Royal mail - UK - Any solution?
hi response inline
On 7/31/07, *Beast900* <ant...@compushopdirect.com> wrote:
Hi Ropu, Thanks for getting in touch,
no problem
i have tried to edit the code for each of my shipping options, but i have gone wrong somewhere, i would be grateful if someone could maybe edit this code or tell what i have done wrong.
i'll try to
i have given each method a unique name is this correct?
correct, but the tag creation is wrong
wrong: $gcheck->push('rm1stclassrec', array ('name' => $shipname)); right:
*$gcheck->push('flat-rate-shipping', array ('name' => $shipname));* $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions');
wrong: $gcheck->pop('rm1stclassrec');
right: *$gcheck->pop('flat-rate -shipping');** * as u see the unique name should be in the name attribute, not in the tag name
i have only one push and pop shipping methods, but are they in the right place?
right place
i also dont want any royal mail options to show if the order is over 1.5kg,
add the logic :D
my initial code works, but i would like to give my customer options which is why i have tried the this
$total_weight = $cart->show_weight(); // $subtotal = $cart->show_total(); /////////////////////////////////////////////////////// Royal Mail 1st Class Recorded if ($total_weight <= 0.1) { $shipval = "3.35"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.1) && ($total_weight <= 0.25)) { $shipval = "3.70"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.25) && ($total_weight <= 0.5)) { $shipval = "4.29 "; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.5) && ($total_weight <= 0.75)) { $shipval = "4.70"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.75) && ($total_weight <= 1)) { $shipval = "5.47"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 1) && ($total_weight <= 1.25)) { $shipval = "7.75"; $shipname = "Royal Mail First Class Recorded Delivery"; } $gcheck->push('shipping-methods'); $gcheck->push('rm1stclassrec', array ('name' => $shipname)); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('rm1stclassrec'); /////////////////////////////////////////////////////// City Link $total_weight = $cart->show_weight(); // $subtotal = $cart->show_total(); if (($total_weight > 0.1) && ($total_weight <= 0.5 )) { $shipval = "5.88"; $shipname = "City Link"; } else if (($total_weight > 0.5) && ($total_weight <= 1)) { $shipval = "7.05"; $shipname = "City Link"; } else if (($total_weight > 1) && ($total_weight <= 5)) { $shipval = "7.64"; $shipname = "City Link"; } else if (($total_weight > 5) && ($total_weight <= 10)) { $shipval = "9.99"; $shipname = "City Link"; } else if (($total_weight > 10) && ($total_weight <= 15)) { $shipval = "11.17"; $shipname = "City Link"; } else if (($total_weight > 15) && ($total_weight <= 20)) { $shipval = "17.63"; $shipname = "City Link"; } else if (($total_weight > 20) && ($total_weight <= 25)) { $shipval = "23.50"; $shipname = "City Link"; } else if (($total_weight > 25) && ($total_weight <= 30)) { $shipval = "29.38"; $shipname = "City Link"; } else if ($total_weight > 30) { $shipval = "35.25"; $shipname = "City Link"; } $gcheck->push('CityLink', array ('name' => $shipname)); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('CityLink'); /////////////////////////////////////////////////////// Royal Mail 1st Class $total_weight = $cart->show_weight(); // $subtotal = $cart->show_total(); if ($total_weight < 0.1) { $shipval = "2.18"; $shipname = "Royal Mail 1st Class"; } else if (($total_weight > 0.1) && ($total_weight <= 0.25)) { $shipval = "2.47"; $shipname = "Royal Mail 1st Class"; } else if (($total_weight > 0.25) && ($total_weight <= 0.5)) { $shipval = " 3.12"; $shipname = "Royal Mail 1st Class"; } else if (($total_weight > 0.5) && ($total_weight <= 0.75)) { $shipval = "3.65"; $shipname = "Royal Mail 1st Class"; } else if (($total_weight > 0.75) && ($total_weight <= 1)) { $shipval = "4.29"; $shipname = "Royal Mail 1st Class"; } else if (($total_weight > 1) && ($total_weight <= 1.25)) { $shipval = "7.35"; $shipname = "Royal Mail 1st Class"; } $gcheck->push('RoyalMail1st', array ('name' => $shipname)); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('RoyalMail1st'); /////////////////////////////////////////////////////// Royal Mail 2nd Class $total_weight = $cart->show_weight(); // $subtotal = $cart->show_total(); if ($total_weight < 0.1) { $shipval = "1.83"; $shipname = "Royal Mail 2nd Class"; } else if (($total_weight > 0.1) && ($total_weight <= 0.25)) { $shipval = "2.22"; $shipname = "Royal Mail 2nd Class"; } else if (($total_weight > 0.25) && ($total_weight <= 0.5)) { $shipval = " 2.58"; $shipname = "Royal Mail 2nd Class"; } else if (($total_weight > 0.5) && ($total_weight <= 0.75)) { $shipval = "3.16"; $shipname = "Royal Mail 2nd Class"; } else if (($total_weight > 0.75) && ($total_weight <= 1)) { $shipval = "3.47"; $shipname = "Royal Mail 2nd Class"; } $gcheck->push('RoyalMail2nd', array ('name' => $shipname)); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('RoyalMail2nd'); $gcheck->pop('shipping-methods');
any pointers would be greatly appreciated.
good luck to everyone getting UK shipping sorted.
Regards
Antony
On Jul 30, 7:52 pm, Ropu < rova...@gmail.com> wrote:
hi u should re do this part of the code for each additional shipping method
$gcheck->push('flat-rate-shipping', array ('name' => $shipname)); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('flat-rate-shipping');
hope this helps
ropu
On 7/30/07, Beast900 <ant...@compushopdirect.com > wrote:
Hello All,
i have managed to hardcode my options with this code, please feel free to copy it and use it for your own.
$total_weight = $cart->show_weight(); // $subtotal = $cart->show_total(); if ($total_weight <= 0.1) { $shipval = "3.35"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.1) && ($total_weight <= 0.25)) { $shipval = "3.70"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.25) && ($total_weight <= 0.5)) { $shipval = "4.29"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.5) && ($total_weight <= 0.75)) { $shipval = "4.70"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 0.75) && ($total_weight <= 1)) { $shipval = "5.47"; $shipname = "Royal Mail First Class Recorded Delivery"; } else if (($total_weight > 1) && ($total_weight <= 5)) { $shipval = "7.64"; $shipname = "City Link"; } else if (($total_weight > 5) && ($total_weight <= 10)) { $shipval = "9.99"; $shipname = "City Link"; } else if (($total_weight > 10) && ($total_weight <= 15)) { $shipval = "11.17"; $shipname = "City Link"; } else if (($total_weight > 15) && ($total_weight <= 20)) { $shipval = " 17.63"; $shipname = "City Link"; } else if (($total_weight > 20) && ($total_weight <= 25)) { $shipval = "23.50"; $shipname = "City Link"; } else if (($total_weight > 25) && ($total_weight <= 30)) { $shipval = "29.38"; $shipname = "City Link"; } else if ($total_weight > 30) { $shipval = "35.25"; $shipname = "City Link"; } $gcheck->push('shipping-methods'); $gcheck->push('flat-rate-shipping', array ('name' => $shipname)); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('flat-rate-shipping'); $gcheck->pop('shipping-methods');
however i would like to hard code second class, and first class non- recorded like above..
does anyone know how i add more shipping options here? what would i need to specify.
Regards
Antnoy
On Jul 27, 11:01 am, Beast900 <ant...@compushopdirect.com> wrote:
I have everything working on version 1.3 but shipping.
i am uk based and am willing to use a work around if possible.
This workaround in gccheckout.php works for cost based shipping.
$gcheck->pop('shipping-methods'); */ $subtotal = $cart->show_total(); if ($subtotal <= 250) { $shipval = "5.00"; $shipname = "Flat rate Google shipping";}
else if (($subtotal > 250) && ($subtotal <= 9999)) { $shipval = "7.00"; $shipname = "Royal Mail special delivery";}
$gcheck->push('shipping-methods'); $gcheck->push('flat-rate-shipping', array ('name' => 'Google Checkout Rate')); $gcheck->element('price', $shipval, array ('currency' => 'GBP')); $gcheck->push('shipping-restrictions'); $gcheck->push('allowed-areas'); $gcheck->push('postal-area'); $gcheck->element('country-code', 'GB'); $gcheck->pop('postal-area'); $gcheck->pop('allowed-areas'); $gcheck->pop('shipping-restrictions'); $gcheck->pop('flat-rate-shipping'); $gcheck->pop('shipping-methods');
does anyone know how to manipulate this code based on weight?
i dont mind using hard code to fix the problem.
i have been using oscommerce forum but it looks as though it has since been deleted.
if anyone has got royal mail first, second, and recorded delivery as
well as cost weight shipping module to work with this please let me know.
i have tried everything but to no avail
any help would be greatly appreciated.
Regards
Antony
-- .-. --- .--. ..- R o p u- Hide quoted text -
- Show quoted text -
-- .-. --- .--. ..- R o p u
-- .-. --- .--. ..- R o p u




