Oba-san
- Join Date:
- Sep 2003
- Location:
- Ohio
- Posts:
- 62,757
- Plugin Contributions:
- 1
Show Item is FREE shipping in the CART.
Thanks for the update that this is now working for you ... :smile:
Views: 3,767
Oba-san
Thanks for the update that this is now working for you ... :smile:
Zen Follower
Ajeh,
just came up, but shipping to Alaska & Hawaii ?
how to EXCLUDE them from the FREE SHIPPING as well ?
Zen Follower
it would be a mod of your custom code ?
// bof: add back weight for Canada
global $order, $cart;
if ($order->delivery['country']['id'] == 38) {
$total_weight += $_SESSION['cart']->free_shipping_weight;
}
// eof: add back weight for Canada
to add the EXCLUSION of Alaskas zone code AK and Hawaii HI ?
Zen Follower
How do you know the ID # ?
as in your code if ($order->delivery['country']['id'] == 38
I do not see 38 in the backend to represent canada ?
Zen Follower
When I click on contries I see it up in the address
/countries.php?page=2&cID=38
I will make copies of the code you made and change the 38 to AK and HI ?
will give it a shot, I have customer waiting in AK to make order :-)
No go, must be a play on the ZONE and not country
Zen Follower
tried this as well
if ($order->delivery['zone']['id'] == AK) { $this->enabled = true; }
and this
if ($order->delivery['zone']['id'] == 2) { $this->enabled = true; }
and this
if ($order->delivery['country']['id']==223['zone']['id'] == 2) { $this->enabled = true; }
Oba-san
Try using:
if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) {
Zen Follower
That stopped the whole shipping to load ?
would I use the same code for the UPS.php and tpl_shopping_cart.php ?
I added { $this->enabled = true; } to the end based on the working code,
just looks like it was left off ?
so is now
if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) { $this->enabled = true; }
This gets a cost to come up to alaska now, but FREE SHIPPING $0 is also still an option, how to get it out ?
Oba-san
Sounds like you have an error on the file when you made that last change ...
What debug logs do you see in the:
/cache
when you make that change?
I put it in the shipping.php class and the shipping module ...
I am not sure what you have in the tpl_shopping_cart_default.php but I am guessing you have an IF to manage the icon so you would need it there too ...
Zen Follower
shipping.php ? not tpl_shpping_cart.php
cache ?
[13-Nov-2010 18:54:38] PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in efpsupply\includes\templates\theme226\templates\tpl_shopping_cart_default.php on line 133
tpl_shpping_cart.php
<?php echo '<br />' . (zen_get_show_product_switch($product['id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($product['id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');?>UPS.php
if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) { $this->enabled = true; }
shipping.php
if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) { $this->enabled = true; }
Alaska still showing FREE option. CANADA still working PERFECTLY..
Zen Follower
Also now, the excluded ones do not seem to be passing the weights ?
United Parcel Service (1 x 0.06lbs) (Ground)
Oba-san
That is a very old debug log ... do you have a new one that is generated today?
Are you testing this on the checkout or the shipping estimator?
Zen Follower
Can I get it to create a new one ?
on checkout.. logged in and can complete the purchase if I want to buy from myself :-)
would you like to log in as me on the site to see ? I have all the addresses to use in the address book on my account.
Oba-san
You may send me a Private Message with the login information and when I get so free time I will try to see what is happening ...
Oba-san
Check the file:
/includes/classes/shipping.php
Do you have this code in there:
function calculate_boxes_weight_and_tare() {
global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
// bof: add back weight for Canada, Alaska and Hawaii
global $order, $cart;
if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) {
$total_weight += $_SESSION['cart']->free_shipping_weight;
}
// eof: add back weight for Canada, Alaska and Hawaii
if (is_array($this->modules)) {
Zen Follower
Will also be on my chat on the site if you want to talk faster :-)
function calculate_boxes_weight_and_tare() {
global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
// bof: allow for Canada, Alaska, Hawaii
if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) { $this->enabled = true; }
// eof: allow for Canada, Alaska, Hawaii
CHANGED IT TO YOURS, think i put the wrong code in the shipping.php
but same results it looks like
Zen Follower
added the spaces from the comments away from the code
and now it seems the weight is comming up in the shipping
even if it does not in the spot above the cart table.
but the free shipping is still showing for those states, is progreess though :-)
Zen Follower
If canada is the only one of the thee that is NOT showing the FREE SHIPPING
then could it be in my zone setups ? as AK & HI are the only two showing free shipping
so must be somethinig else that is getting them to prompt still ?
Oba-san
Go to phpMyAdmin and browse the table:
zones
what are the settings for:
Alaska
Hawaii
Browse the table:
countries
what are the settings for:
United States
Canada
Zen Follower
zone_id zone_country_id zone_code zone_name
2 223 AK Alaska
21 223 HI Hawaii
countries_id countries_name countries_iso_code_2 countries_iso_code_3 address_format_id
223 United States US USA 2
38 Canada CA CAN 2
this wat you are looking for ?
Tell staff why this post should be reviewed.