Forums / Addon Shipping Modules / Hide module from certain state

Hide module from certain state

Started by jimmie on 12 Nov 2014, 3:09 AM · Views: 3,404

Results 21 to 40 of 41
22 Nov 2014, 12:33 AM
#21
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Hide module from certain state

sorry wrong quantity
QTY 1136.4 would like it to convert to cartons but, i know that aint easy.
What would you suggest would be the best way of handling this.
i have two instances of Advanced shipper, but only has fedex freight,
i am trying to get this freigtquote module working with my site.

22 Nov 2014, 12:37 AM
#22
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

eliminating the decimals
this way is probaly the better

ceil(1137 * 1.583949313621964) = 1801
22 Nov 2014, 12:39 AM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide module from certain state

Which do you want for the weight:
Quantity 1136.4 and Weight 1.583949313621964
1136.4 * 1.583949313621964 = 1800
-- or --
ceil(1136.4 * (int)1.583949313621964) = 1137
-- or --
ceil(1136.4 * 1.583949313621964) = 1800

Quantity 1200 and Weight 1.583949313621964
What do you want it to equal?
1200 * 1.583949313621964 = 1900.7391763464
-- or --
ceil(1200 * (int)1.583949313621964) = 1200
-- or --
ceil(1200 * 1.583949313621964) = 1901

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Nov 2014, 1:00 AM
#24
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

ceil(1136.4 * 1.583949313621964) = 1800

22 Nov 2014, 1:01 AM
#25
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Hide module from certain state

jimmie:

eliminating the decimals
this way is probaly the better

ceil(1137 * 1.583949313621964) = 1801


You cannot make up results you only can use what will really calculate ...

ceil(1137 * 1.583949313621964) = 1800


So if:
**Quantity 1.25 and Weight 1.25**
ceil(1.25 * 1.25) = 2

**Quantity 1200 and Weight 1.583949313621964**
ceil(1200 * 1.583949313621964) = 1901 

**Quantity 1136.4 and Weight 1.583949313621964**
ceil(1136.4 * 1.583949313621964) = 1800

work for you, then use in your code for Weight:

'Weight' => ceil($product['quantity'] * $product['weight']),

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Nov 2014, 1:03 AM
#26
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

i figured out what piececount does, it is how many pallets i am shipping i just did this for that so that is done

'PieceCount' => '1',
22 Nov 2014, 1:10 AM
#27
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

one more thing before you go
this

$shipping_form = '';
      if ($_POST['action'] != 'process') {
        $shipping_form  = '<table border="0" cellspacing="0" cellpadding="2">';
        $shipping_form .= '<tr><td class="main" width="120">Delivery Location:</td><td class="main">';
        $shipping_form .= '<select name="freightquote_delivery_location" onchange="window.location.href=\'' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'freightquote_delivery_location=') . '\'+this.value">';
        $shipping_form .= '<option value="0"' . ($delivery_location == '0' ? ' SELECTED' : '') . '>Residence</option>';
        $shipping_form .= '<option value="1"' . (!isset($delivery_location) || $delivery_location == '1' ? ' SELECTED' : '') . '>Commercial (no loading dock)</option>';
        $shipping_form .= '<option value="2"' . ($delivery_location == '2' ? ' SELECTED' : '') . '>Commercial (with loading dock)</option>';
        $shipping_form .= '<option value="3"' . ($delivery_location == '3' ? ' SELECTED' : '') . '>Construction Site</option>';
        $shipping_form .= '</select></td></tr>';
        $shipping_form .= '</table>';
      } else {
        $shipping_form  = '<br>Delivery Location: ';
        switch ($delivery_location) {
          case '0':
            $shipping_form .= 'Residence';
            break;
          case '2':
            $shipping_form .= 'Commercial (with loading dock)';
            break;
          case '3':
            $shipping_form .= 'Construction Site';
            break;
          case '1':
          default:
            $shipping_form .= 'Commercial (no loading dock)';
            break;
        }
      }

when on shopping cart page and they pick commercial sends them to checkout_shipping with no change
if i do this

. zen_href_link(FILENAME_SHOPPING_CART,

it works as it should. but when they check out it sends them back to shopping cart.
if i remove the link they have to update cart.

22 Nov 2014, 1:39 AM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Hide module from certain state

Can you attach a .zip of the module PHP file?
Or at least a URL to the site so we can look at the javascript in action? And any special instructions for putting the right things into the cart to trigger the problem?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Nov 2014, 1:05 PM
#31
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

i think i need something like this

$shipping_form .= '<select name="freightquote_delivery_location" onchange="window.location.href=\'' . zen_href_link( basename( $PHP_SELF ), zen_get_all_get_params() . '&freightquote_delivery_location=') . '\'+this.value">';

This does not work

23 Nov 2014, 4:05 AM
#32
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

when i turn off fast and easy checkout, this works on checkout page

. zen_href_link(FILENAME_CHECKOUT_SHIPPING

but when a customer is viewing shopping cart and change the selection, they are redirected to the checkout page, where they would than have to create an account or login to continue, i want them to see the change before checkout.

26 Nov 2014, 4:25 AM
#33
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

when a customer has multiple ship to addresses in account and chooses a different one, the shopping cart refreshes but does not update to new address until they hit update cart, it will then update to new address.
how to make it refresh and update automatically?
this is site
http://floorz-n-more.com/
create account add two addresses add something to cart, try changing address

28 Nov 2014, 5:06 AM
#34
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

does css/js loader or its settings have anything to do with this?

1 Dec 2014, 12:17 PM
#35
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

still need help here

2 Dec 2014, 1:04 AM
#36
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

is this either

$shipping_form = '';
      if ($_POST['action'] != 'process') {
        $shipping_form  = '<table border="0" cellspacing="0" cellpadding="2">';
        $shipping_form .= '<tr><td class="main" width="200">Please Choose Your Delivery Location:</td><td class="main">';
        $shipping_form .= '<select name="freightquote_delivery_location" onchange="window.location.href=\'' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'freightquote_delivery_location=') . '\'+this.value">';
        $shipping_form .= '<option value="0"' . ($delivery_location == '0' ? ' SELECTED' : '') . '>Residential Delivery (Curbside drop off only)</option>';
        $shipping_form .= '<option value="1"' . (!isset($delivery_location) || $delivery_location == '1' ? ' SELECTED' : '') . '>Business Delivery:(no loading dock) Home Businesses do not quality</option>';
        $shipping_form .= '<option value="2"' . ($delivery_location == '2' ? ' SELECTED' : '') . '>Business Delivery:(with loading dock) Home Businesses do not quality</option>';
        $shipping_form .= '<option value="3"' . ($delivery_location == '3' ? ' SELECTED' : '') . '>Jobsite Delivery</option>';
		$shipping_form .= '<option value="4"' . ($delivery_location == '4' ? ' SELECTED' : '') . '>Pick Up at Carrier Terminal</option>';
        $shipping_form .= '</select></td></tr>';
        $shipping_form .= '</table>';
      } else {
        $shipping_form  = '<br>Delivery Location: ';
        switch ($delivery_location) {
          case '0':
            $shipping_form .= 'Residence';
            break;
          case '2':
            $shipping_form .= 'Commercial (with loading dock)';
            break;
          case '3':
            $shipping_form .= 'Construction Site';
            break;
		  case '4':
            $shipping_form .= 'Pick Up At Carrier Terminal';
            break;
          case '1':
          default:
            $shipping_form .= 'Commercial (no loading dock)';
            break;
        }
      }

how would i convert this to either?
thank you

5 Dec 2014, 3:07 AM
#37
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

$form .= '<select name="some_name" onchange="window.location.href=\'' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'some_name=') . '\'+this.value">';

I have been reading and trying different thing but cant figure it out.
The part in red, i would like it to stay on same page when it updates, right now when it updates it goes to to checkout.

5 Dec 2014, 3:31 AM
#38
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

with order total for shipping activated, that will change to the selected value, but the option below is still default selected

13 Dec 2014, 3:27 AM
#39
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

Re: Hide module from certain state

Here is entire section of code
Need to make this stay on same page and not go to checkout

$shipping_form = '';
      if ($_POST['action'] != 'process') {
        $shipping_form  = '<table border="0" cellspacing="0" cellpadding="2">';
        $shipping_form .= '<tr><td class="main" width="200">Please Choose Your Delivery Location:</td><td class="main">';
        $shipping_form .= '<select name="freightquote_delivery_location" onchange="window.location.href=\'' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, 'freightquote_delivery_location=') . '\'+this.value">';
        $shipping_form .= '<option value="0"' . ($delivery_location == '0' ? ' SELECTED' : '') . '>Residential Delivery (Curbside drop off only)</option>';
        $shipping_form .= '<option value="1"' . (!isset($delivery_location) || $delivery_location == '1' ? ' SELECTED' : '') . '>Business Delivery:(no loading dock) Home Businesses do not quality</option>';
        $shipping_form .= '<option value="2"' . ($delivery_location == '2' ? ' SELECTED' : '') . '>Business Delivery:(with loading dock) Home Businesses do not quality</option>';
        $shipping_form .= '<option value="3"' . ($delivery_location == '3' ? ' SELECTED' : '') . '>Jobsite Delivery</option>';
		$shipping_form .= '<option value="4"' . ($delivery_location == '4' ? ' SELECTED' : '') . '>Terminal Delivery</option>';
        $shipping_form .= '</select></td></tr>';
        $shipping_form .= '</table>';
      } else {
        $shipping_form  = '<br>Delivery Location: ';
        switch ($delivery_location) {
          case '0':
            $shipping_form .= 'Residence';
            break;
          case '2':
            $shipping_form .= 'Commercial (with loading dock)';
            break;
          case '3':
            $shipping_form .= 'Construction Site';
            break;
		  case '4':
            $shipping_form .= 'Pick Up At Carrier Terminal';
            break;
          case '1':
          default:
            $shipping_form .= 'Commercial (no loading dock)';
            break;
        }
      }
14 Dec 2014, 8:08 PM
#40
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Hide module from certain state

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.