Post by GatorTim » Sun Jul 10, 2016 6:11 am

Pay with Amazon is requiring users to select a shipping address and method. But of the cart only contains items that do not require shipping, it should be skipping this step. Right? How do I get it to work with items that do not require shipping?
Last edited by GatorTim on Wed Jul 13, 2016 8:45 pm, edited 1 time in total.

Newbie

Posts

Joined
Thu Jun 02, 2016 8:23 pm

Post by straightlight » Tue Jul 12, 2016 10:57 am

In catalog/controller/payment/amazon_login_pay.php file,

find both instances of:

Code: Select all

foreach ($this->cart->getProducts() as $product) {
add after each:

Code: Select all

if (!$this->cart->hasShipping()) {
Then, find:

Code: Select all

}

		$data['vouchers'] = array();
replace with:

Code: Select all

}
}

		$data['vouchers'] = array();
Then, find:

Code: Select all

}

		$order_data['products'] = $product_data;
replace with:

Code: Select all

}
}

		$order_data['products'] = $product_data;
A second option would be to edit your admin products and not to select shipping on all products that does not require shipping. It can also be done in batch from PHPMyAdmin. The only problem with these options compared to the first codes edit solution would be if the customer does not select amazon pay login while the first solution provides restricted results to no shipping products only.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by GatorTim » Tue Jul 12, 2016 7:22 pm

Straightlight,

Thanks for the quick reply. I made the changes you outlined in the first solution, but it didn't have any affect. I am still getting prompted to select a shipping address and shipping method, but then there are no shipping methods available because there is no products that require shipping. It really should bypass the shipping address step altogether when the cart doesn't have any items that require shipping.

I didn't understand the second option. If you are referring to editing the products that are downloads to set the Requires Shipping field to no, then the downloadable items are already set that way. That is why the standard checkout bypasses that step. I just want the pay with amazon to work the same way.

I guess I could install free shipping and then use my Restrict Shipping module to make it so that is available only for downloadable items. But that still requires the user to go through an extra step.

Newbie

Posts

Joined
Thu Jun 02, 2016 8:23 pm

Post by straightlight » Tue Jul 12, 2016 7:35 pm

GatorTim wrote:Straightlight,

Thanks for the quick reply. I made the changes you outlined in the first solution, but it didn't have any affect. I am still getting prompted to select a shipping address and shipping method, but then there are no shipping methods available because there is no products that require shipping. It really should bypass the shipping address step altogether when the cart doesn't have any items that require shipping.

I didn't understand the second option. If you are referring to editing the products that are downloads to set the Requires Shipping field to no, then the downloadable items are already set that way. That is why the standard checkout bypasses that step. I just want the pay with amazon to work the same way.

I guess I could install free shipping and then use my Restrict Shipping module to make it so that is available only for downloadable items. But that still requires the user to go through an extra step.
The point above regarding checkout validation over product types is a good one. This should be a suggested feature that only product variations should require to fill out the extra steps in checkout. Although, at the actual time, what you are amending from the core would take several modifications. Better, yet, to look for an extension that would match your needs. If none can be found, perhaps to post this request in the commercial support section of the forum.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by GatorTim » Wed Jul 13, 2016 8:42 pm

Marking solved. I decided that Login and Pay with Amazon doesn't fit my needs given a number of issues.

Newbie

Posts

Joined
Thu Jun 02, 2016 8:23 pm
Who is online

Users browsing this forum: No registered users and 5 guests