Can FedEx shipping methods be suppressed when an address contains a P.O. Box in Hotcakes? - e-commerce

We are wondering if in Hotcakes 1.10.3, if the shipping method lookup can recognize if an address entered is a P.O. Box before returning available shipping methods.
Why we ask - our client is primarily using FedEx to deliver shipiments, but would like to default to USPS shipping methods when a customer enters a P.O. box as FedEx doesn't deliver to P.O. boxes.
I've tried out a few PO box addresses, and in our current build FedEx rates still get returned. Is there any way to block FedEx from returning if a P.O. box is entered as an address in Checkout?
Thanks much.

Disclaimer: I work for Hotcakes.
I looked at this in our code base and it was interesting to see that we're simply taking the address entered by the customer in checkout and passing it directly to the shipping provider (e.g., FedEx). In my testing using FedEx specifically, they're returning rates from their own web service, regardless to whether the address is a P.O. Box or not. They don't seem to be checking for this themselves. I didn't check the other built-in live rate providers for this answer.
I order to workaround this, you can detect this yourself and prevent this from happening in your custom viewset. However, you should be aware that doing this would really require that you test all of the use cases that you expect for your target customers to fall into on your site.
In your viewset, find the Checkout.js file in the Scripts folder.
In this file, you'll want to look for the following method and apply a check to see if the Address 1 field is a P.O. Box or not. If it is, remove the FedEx rates from the list of shipping providers that received rates. This will prevent your customer from selecting unsupported rates.
RefreshShippingRates
An example of that check in this JS file might look like this:
var address1Value = $('#shippingaddress').val()
if (address1Value.substring(0, 4) == "P.O.") {
// iterate through each rate to see if it needs to be removed
}

Related

Integrating Shopify and third-party gift-card system

Background
I am working with a retailer who has a store on Shopify. The store is not
on Shopify Plus.
The retailer has gift cards from a company other than Shopify. Each gift
card has a number on it that uniquely identifies the card. Associated with
the cards is a HTTP API, available to authenticated users, which can be used
to get or change the balance on a card.
Requirement
The retailer wants to allow customers to use these cards when ordering from
his Shopify store.
Ideal UI
From the user-interface point of view, the ideal would probably be something
like the following. We would add an input field to the Shopify payment
form, near the input field that has the placeholder "Gift card or discount
code". This new input field would be for the third-party gift-card number.
Suppose a customer had a gift card and entered its number into this input
field. Some custom software would check whether the gift-card number was
valid and the gift-card had funds. If either check failed, an error message
would appear in the form.
If both checks succeeded, the form would show success (perhaps by putting a
green check mark) next to the input field. Then it would adjust the balance
to be paid by the customer. For example, if the customer was ordering $300
worth of shoes, and tendered a gift card holding $50, then the $300 would be
adjusted to $250.
When the customer pressed the button to place the order, Shopify would debit
$250 from his credit or debit card, and some custom software would debit $50
from his gift card. It's probably acceptable for this custom software to
run after a delay of 5 seconds or so. (For example, it might be triggered
by a webhook.)
Discussion
I've been looking for a way to do the above. The really hard part is to
adjust $300 to $250 (not just in the form, but when Shopify actually charges
the customer). I have considered the following, singly and in combination:
Changing the Liquid templates.
Putting some custom JavaScript in the Shopify pages.
Writing an app that uses the Shopify Storefront API.
(3) seems the most promising, but it's not easy to see how to do in a "surgical"
way so that I only replace one screen.
I don't want to have to reimplement an entire Shopify store using the Storefront API.
Alternative UI
If you can think of an alternative UI that would achieve the same thing,
please feel free to propose it.
Similar question
This question,
including the questioner's two comments, describes a situation
identical to mine.
However, the only answer (if I understand it correctly) is unacceptable to me.
Ruled-out alternative
I proposed a web service to turn these third-party gift cards into Shopify
discount codes. That idea was rejected by the retailer, because he already
uses Shopify discount codes, and Shopify's form only allows a single
discount code.

How do I enable 2Checkout to accept Billing / Shipping Address for all Countires across the world?

I am using "ConvertPlus Default" Checkout Theme in 2Checkout to accept international payments from my customers across the world. I generated the Buy Link and integrated with my store.
My issue is that the Checkout Form is not showing fields to input Address and City for many countries including Mexico, Japan etc. Refer screenshot below:
How do I enable the option to accept Complete Address information for all countries across the world?
Buy Link looks like this:
https://secure.2checkout.com/checkout/buy/?merchant=\[MerchantID\]&prod=\[ProductID\]&qty=1&tpl=default
You should add the tangible parameter
Send tangible=TRUE or tangible=1 for products that require physical delivery.
As of 10/01/2019 the parameter you will need to enable shipping is
li_#_tangible
The documentation says this.
Specifies if the corresponding li_#type is a tangible or intangible.
( Must be Upper Case, ‘Y’ or ‘N’, if li#_type is ‘shipping’ forced to
‘Y’.)
Where # is the parameter number. Because you can send multile items in the same POST so it will appear as multiple items in the 2CO cart.
Here is the full documentation about parameters,
https://www.2checkout.com/documentation/checkout/parameters/
Hope this helps someone.
Cheers.

Bigcommerce custom shipping handling

I have a client who wants an eCommerce site but they have to have a custom shipping service. The way shipping will work will be as follows:
When the online customer is placing the order and is shown the shipping page, this page must query the custom shipping service passing all the order information (as JSON). The shipping service will return a JSON array containing ShipmentOption objects. Each ShipmentOption object contains the shipping method name and the total price of shipping the items on the order to the online customer's address.
Can the BigCommerce platform handle the above requirement? If yes, can you please send me the URL to the pages that explain to me how to set this up or send me the instructions please?
This isn't possible to accomplish with Bigcommerce, but you may be able to use ShipperHQ to host the same logic and get similar, if not the same, quotes.

Can I force the "From" to international sms numbers

I have created an application that that sends error notifications to some mobile numbers located inside and outside of the United States via Twilio.
Inside the United states I get the expected results. The message shows that it is coming from my Twilio assigned phone number. However, when I test to an international destination; the results are unpredictable.
Sometimes I receive the message "from" a long number that is almost never the same twice. Other times I receive the message "from" a meaningless and sometimes strange "short code" that changes frequently as well.
How can I prevent this unwanted, unpredictable behavior?
Twilio Customer Support here - this is not really a stack overflow question as its to do with the way carriers send SMS in certain markets, but if you write into the help#twilio.com we'll explain in more detail.
Different countries actually have different policies about sender IDs. In some countries you are able to deliver A2P traffic only from alpha senders, for example. In other countries you might be able to send messages only from a local longode sender ID or from a shortcode like in USA. There are also often different routes available which may support different features. If you would like to test out features of the route your current SMS supplier has, you can send test SMS messages on mobile test numbers of telqtest.com

Switch the shipping rate dynamically in Shopify

I'm planning a new Shopify project, and the site requires a different shipping cost depending on the postal area of a postcode (e.g. SE1, N7). The plan was to manually add different shipping options inside of Shopify, then AJAX GET /cart/shipping_rates.json, and manually filter to the correct shipping rate by matching the name to postal area.
But my question is -- is there any way to carry over this shipping method to the Checkout as a selected option, and hide the Shipping Method drop-down from the checkout to prevent them choosing a different the shipping cost?
... Or, ideally, is there a way for me to directly override shipping costs through the API?
I don't know of any onboard functionality, which can facilitate this.
But there is a quite hacky workaround, that I use to filter the shipping rates in the checkout page.
Through the "Additional Google Analytics Javascript" field you can sneak a JS on every page of the shop, including the checkout. Here you can basically manipulate the shipping rates as you like.
In your case, the code must be aware of the shipping_address zip code. You can try to set a cookie on the first checkout page and then read the same cookie on the second.
Unfortunately, this isn’t possible with Shopify’s existing checkout.