You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I currently only use UPS as the shipper, but need to add a local pick up option that won't add a shipping charge. What's the best way to do this?
Thanks,
Offline
(1) In admin under Store > Shipping > Custom Shipping Methods, choose to add a new custom shipping method. Use 'upswithpickup' as the 'Identifier', 'UPS With Pickup' as the 'Display Name' and enter the following for the 'Shipping Method PHP Content':
<?php $info = $this->globals('ecom.customship'); $custom = array(); $delinfo = array('stateprov' => $info['stateprov'], 'country' => $info['country'], 'postalcode' => $info['postalcode'], 'rescom' => $info['rescom'], 'shipstateprov' => $info['shipstateprov'], 'shipcountry' => $info['shipcountry'], 'shipzip' => $info['shipzip'], 'shipmethods' => 'UPSTOOLS', 'shiptype' => 'R'); $result = $this->include_namespace('ecom','shiprealtime',array('delinfo' => $delinfo, 'packages' => $info['packages'])); foreach ($result as $num => $service) { $custom[$service['name']] = $service['amount']; } // End of foreach statement. $custom['Local Pickup'] = '0.00'; $this->globals('ecom.customship_response',$custom); ?>
(2) Access System > Database > Raw Database Admin and choose to submit a Raw SQL Statement. Submit this statement:
UPDATE ecom_prod SET delmethod='C', customship='upswithpickup' WHERE delmethod='R'
This will add a custom shipping script that uses UPS realtime rates with a local pickup option, and assign all of your realtime shipped products to that custom script.
Offline
I did that and it did not work. It did not add the local pick up option and instead of using real time pricing it used the method based pricing, which the database forces you to put in a number, even if you're using the real time shipping quotes.
So how do I fix that?
Offline
The code I posted works. Please be aware you'll need to clear your cart and re-add items to it after making the change to see the new script and product parameters working.
Offline
I did clear the cart and restart, and it made a change - it used applied the product based shipping price only and did not show the local pick up option. I don't understand why it went to read that code even and not the real shipping proposals.
I would love to get your code to work as it is the most simple to apply compared with other methods I have seen posted...
Offline
Did you set your products shipping option to custom with the new script selected in the custom shipping method? This would have to be done for every product you want the in-store pickup option to appear.
John
Offline
Did you set your products shipping option to custom with the new script selected in the custom shipping method? This would have to be done for every product you want the in-store pickup option to appear.
This. That's why I gave you the SQL to do. Access System > Database > Raw Database Admin and choose to submit a Raw SQL Statement. Submit this statement:
UPDATE ecom_prod SET delmethod='C', customship='upswithpickup' WHERE delmethod='R'
Offline
Yes, I have done all of that. The only thing the code gives me is a flat $25.00 delivery charge. It doesn't even give a local pick up or vary for the shipping distance. I think it has to be using the product based shipping number, or else I have no idea where it even got $25.00 from. Any help would be Hugely appreciated.
Offline
It probably got the $25 as the shipping error amount as entered under Store | Component | Settings | Shipping Settings. If this is the case, you:
(1) Might have an error in your PHP code in your shipping script.
(2) Might not have configured your USPS Connection yet under Store | Shipping.
Or, maybe you're using product based shipping for your products. Make sure all of your products are set up to use the custom shipping script and custom shipping.
Offline
I just checked and confirmed that the UPS USPS connection is configured and active. I inserted the code exactly as it was given.
I went and put one of the products to product based shipping, and the prices are different, so I have confirmed it is not that.
So, that leaves an error in the php code in my shipping script. I inserted the custom code exactly as it was given above. Is there another place I should check the shipping script?
Offline
Their are two > in the code that is building the custom array that is causing it to fail, the code should be
<?php $info = $this->globals('ecom.customship'); $custom = array(); $delinfo = array('stateprov' => $info['stateprov'], 'country' => $info['country'], 'postalcode' => $info['postalcode'], 'rescom' => $info['rescom'], 'shipstateprov' => $info['shipstateprov'], 'shipcountry' => $info['shipcountry'], 'shipzip' => $info['shipzip'], 'shipmethods' => 'UPSTOOLS', 'shiptype' => 'R'); $result = $this->include_namespace('ecom','shiprealtime', array('delinfo' => $delinfo, 'packages' => $info['packages'])); foreach ($result as $num => $service) { $custom[$service['name']] = $service['amount']; } // End of foreach statement. $custom['Local Pickup'] = '0.00'; $this->globals('ecom.customship_response',$custom); ?>
John
Offline
It worked! Thank you!
Offline