[Skip to main content](#vessel-content)

#   Force a payment method?

##

- **[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")**
- [![TheBeacon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30945-thebeacon "View TheBeacon's Profile") Topic Author
- [ Offline](/forum/user/30945-thebeacon)

Less More

- Posts: 28
- Thank you received: 1
-
-

11 years 3 months ago [\#207000](#207000) by [TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")  *[Force a payment method?](/forum/29-payment-methods/877906-force-a-payment-method#207000 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.x  Hi,  I have a little bit of a complex issue I am trying to sort out.  We currently have 2 Warehouses configured with products assigned to their appropriate warehouse... 1. Order 2. Pre-Order  We then have shipping methods that are tied to the warehouses...  Restricted to the Order warehouse: 1. US Shipping 2. Canadian Shipping 3. EU Shipping 4. International Shipping.  and...  Restricted to the Pre-Order warehouse: 5. Pre-Order US Shipping 6. Pre-Order Canadian Shipping 7. Pre-Order EU Shipping 8. Pre-Order International Shipping.  Finally we have two payment methods... 1. PayPal - Restricted to shipping methods 1-4 (We do this so that International users dont have to worry about credit card restrictions and transactions being blocked by their bank.)  2. Manual Credit Card - Restricted to shipping methods 5-8 (this is because the user is not actually charged until the product is shipped, and this can some times be a long ways out.)  This all works really well, right up until we get a mixed cart with products from multiple warehouses. The shipping results in two shipping methods being selected, which is expected. The payments is where it breaks down. We either need a way to force Credit Card method when a cart has a mixed order. So that we can only charge a credit card manually for the amount that is being shipped immediately.  Any suggestions?")* was created by *[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.x

Hi,

I have a little bit of a complex issue I am trying to sort out.

We currently have 2 Warehouses configured with products assigned to their appropriate warehouse...
1. Order
2. Pre-Order

We then have shipping methods that are tied to the warehouses...

Restricted to the Order warehouse:
1. US Shipping
2. Canadian Shipping
3. EU Shipping
4. International Shipping.

and...

Restricted to the Pre-Order warehouse:
5. Pre-Order US Shipping
6. Pre-Order Canadian Shipping
7. Pre-Order EU Shipping
8. Pre-Order International Shipping.

Finally we have two payment methods...
1. PayPal - Restricted to shipping methods 1-4
(We do this so that International users dont have to worry about credit card restrictions and transactions being blocked by their bank.)

2. Manual Credit Card - Restricted to shipping methods 5-8
(this is because the user is not actually charged until the product is shipped, and this can some times be a long ways out.)

This all works really well, right up until we get a mixed cart with products from multiple warehouses. The shipping results in two shipping methods being selected, which is expected. The payments is where it breaks down. We either need a way to force Credit Card method when a cart has a mixed order. So that we can only charge a credit card manually for the amount that is being shipped immediately.

Any suggestions?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84Nzc5MDYtZm9yY2UtYS1wYXltZW50LW1ldGhvZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

11 years 3 months ago [\#207001](#207001) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Force a payment method?](/forum/29-payment-methods/877906-force-a-payment-method#207001 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.x  Hi,  I have a little bit of a complex issue I am trying to sort out.  We currently have 2 Warehouses configured with products assigned to their appropriate warehouse... 1. Order 2. Pre-Order  We then have shipping methods that are tied to the warehouses...  Restricted to the Order warehouse: 1. US Shipping 2. Canadian Shipping 3. EU Shipping 4. International Shipping.  and...  Restricted to the Pre-Order warehouse: 5. Pre-Order US Shipping 6. Pre-Order Canadian Shipping 7. Pre-Order EU Shipping 8. Pre-Order International Shipping.  Finally we have two payment methods... 1. PayPal - Restricted to shipping methods 1-4 (We do this so that International users dont have to worry about credit card restrictions and transactions being blocked by their bank.)  2. Manual Credit Card - Restricted to shipping methods 5-8 (this is because the user is not actually charged until the product is shipped, and this can some times be a long ways out.)  This all works really well, right up until we get a mixed cart with products from multiple warehouses. The shipping results in two shipping methods being selected, which is expected. The payments is where it breaks down. We either need a way to force Credit Card method when a cart has a mixed order. So that we can only charge a credit card manually for the amount that is being shipped immediately.  Any suggestions?")*

Hi,

The simplest would be to remove the shipping methods restriction on the manual credit card payment method.
That way, this payment method will always display.
Then, if PayPal is the first one (based on the ordering) it will be selected automatically by the system.
Finally, you want to edit the file "payment" of the view "checkout" via the menu display&gt;views and add such code at the top:
&lt;?php if(count($this-&gt;methods)==2) array_pop($this-&gt;methods); ?&gt;

That will remove the second choice of the payment methods selection area when there are two payment methods found by the system.

The following user(s) said Thank You: [TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84Nzc5MDYtZm9yY2UtYS1wYXltZW50LW1ldGhvZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")**
- [![TheBeacon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30945-thebeacon "View TheBeacon's Profile") Topic Author
- [ Offline](/forum/user/30945-thebeacon)

Less More

- Posts: 28
- Thank you received: 1
-
-

11 years 3 months ago [\#207089](#207089) by [TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")  Replied by *[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")* on topic *[Force a payment method?](/forum/29-payment-methods/877906-force-a-payment-method#207089 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.x  Hi,  I have a little bit of a complex issue I am trying to sort out.  We currently have 2 Warehouses configured with products assigned to their appropriate warehouse... 1. Order 2. Pre-Order  We then have shipping methods that are tied to the warehouses...  Restricted to the Order warehouse: 1. US Shipping 2. Canadian Shipping 3. EU Shipping 4. International Shipping.  and...  Restricted to the Pre-Order warehouse: 5. Pre-Order US Shipping 6. Pre-Order Canadian Shipping 7. Pre-Order EU Shipping 8. Pre-Order International Shipping.  Finally we have two payment methods... 1. PayPal - Restricted to shipping methods 1-4 (We do this so that International users dont have to worry about credit card restrictions and transactions being blocked by their bank.)  2. Manual Credit Card - Restricted to shipping methods 5-8 (this is because the user is not actually charged until the product is shipped, and this can some times be a long ways out.)  This all works really well, right up until we get a mixed cart with products from multiple warehouses. The shipping results in two shipping methods being selected, which is expected. The payments is where it breaks down. We either need a way to force Credit Card method when a cart has a mixed order. So that we can only charge a credit card manually for the amount that is being shipped immediately.  Any suggestions?")*

Thank you much!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84Nzc5MDYtZm9yY2UtYS1wYXltZW50LW1ldGhvZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")**
- [![TheBeacon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30945-thebeacon "View TheBeacon's Profile") Topic Author
- [ Offline](/forum/user/30945-thebeacon)

Less More

- Posts: 28
- Thank you received: 1
-
-

11 years 3 months ago -  11 years 3 months ago [\#207104](#207104) by [TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")  Replied by *[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")* on topic *[Force a payment method?](/forum/29-payment-methods/877906-force-a-payment-method#207104 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.x  Hi,  I have a little bit of a complex issue I am trying to sort out.  We currently have 2 Warehouses configured with products assigned to their appropriate warehouse... 1. Order 2. Pre-Order  We then have shipping methods that are tied to the warehouses...  Restricted to the Order warehouse: 1. US Shipping 2. Canadian Shipping 3. EU Shipping 4. International Shipping.  and...  Restricted to the Pre-Order warehouse: 5. Pre-Order US Shipping 6. Pre-Order Canadian Shipping 7. Pre-Order EU Shipping 8. Pre-Order International Shipping.  Finally we have two payment methods... 1. PayPal - Restricted to shipping methods 1-4 (We do this so that International users dont have to worry about credit card restrictions and transactions being blocked by their bank.)  2. Manual Credit Card - Restricted to shipping methods 5-8 (this is because the user is not actually charged until the product is shipped, and this can some times be a long ways out.)  This all works really well, right up until we get a mixed cart with products from multiple warehouses. The shipping results in two shipping methods being selected, which is expected. The payments is where it breaks down. We either need a way to force Credit Card method when a cart has a mixed order. So that we can only charge a credit card manually for the amount that is being shipped immediately.  Any suggestions?")*

After further inspection, it seems that payment method order is being determined by which product appears first in the cart so if the cart order is

1. Pre-Order Product
2. Order Product

the payment order method is regardless of (payment method ordering):

1. Credit Card
2. Paypal

if i reverse the order something is added to the cart, the payment order is reversed...

the result is when using array pop, the last method is being trimmed off regardless of what the ordering is and we result in the undesired payment method.

Last edit: 11 years 3 months ago by [TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84Nzc5MDYtZm9yY2UtYS1wYXltZW50LW1ldGhvZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")**
- [![TheBeacon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30945-thebeacon "View TheBeacon's Profile") Topic Author
- [ Offline](/forum/user/30945-thebeacon)

Less More

- Posts: 28
- Thank you received: 1
-
-

11 years 3 months ago [\#207119](#207119) by [TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")  Replied by *[TheBeacon](/forum/user/30945-thebeacon "View TheBeacon's Profile")* on topic *[Force a payment method?](/forum/29-payment-methods/877906-force-a-payment-method#207119 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.x  Hi,  I have a little bit of a complex issue I am trying to sort out.  We currently have 2 Warehouses configured with products assigned to their appropriate warehouse... 1. Order 2. Pre-Order  We then have shipping methods that are tied to the warehouses...  Restricted to the Order warehouse: 1. US Shipping 2. Canadian Shipping 3. EU Shipping 4. International Shipping.  and...  Restricted to the Pre-Order warehouse: 5. Pre-Order US Shipping 6. Pre-Order Canadian Shipping 7. Pre-Order EU Shipping 8. Pre-Order International Shipping.  Finally we have two payment methods... 1. PayPal - Restricted to shipping methods 1-4 (We do this so that International users dont have to worry about credit card restrictions and transactions being blocked by their bank.)  2. Manual Credit Card - Restricted to shipping methods 5-8 (this is because the user is not actually charged until the product is shipped, and this can some times be a long ways out.)  This all works really well, right up until we get a mixed cart with products from multiple warehouses. The shipping results in two shipping methods being selected, which is expected. The payments is where it breaks down. We either need a way to force Credit Card method when a cart has a mixed order. So that we can only charge a credit card manually for the amount that is being shipped immediately.  Any suggestions?")*

so basically I need to figure out a way to sort the cart items by warehouse and I think this will do the trick

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84Nzc5MDYtZm9yY2UtYS1wYXltZW50LW1ldGhvZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

11 years 3 months ago [\#207136](#207136) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Force a payment method?](/forum/29-payment-methods/877906-force-a-payment-method#207136 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.x  Hi,  I have a little bit of a complex issue I am trying to sort out.  We currently have 2 Warehouses configured with products assigned to their appropriate warehouse... 1. Order 2. Pre-Order  We then have shipping methods that are tied to the warehouses...  Restricted to the Order warehouse: 1. US Shipping 2. Canadian Shipping 3. EU Shipping 4. International Shipping.  and...  Restricted to the Pre-Order warehouse: 5. Pre-Order US Shipping 6. Pre-Order Canadian Shipping 7. Pre-Order EU Shipping 8. Pre-Order International Shipping.  Finally we have two payment methods... 1. PayPal - Restricted to shipping methods 1-4 (We do this so that International users dont have to worry about credit card restrictions and transactions being blocked by their bank.)  2. Manual Credit Card - Restricted to shipping methods 5-8 (this is because the user is not actually charged until the product is shipped, and this can some times be a long ways out.)  This all works really well, right up until we get a mixed cart with products from multiple warehouses. The shipping results in two shipping methods being selected, which is expected. The payments is where it breaks down. We either need a way to force Credit Card method when a cart has a mixed order. So that we can only charge a credit card manually for the amount that is being shipped immediately.  Any suggestions?")*

Hi,

Ah I see, that's because you are redirected to the checkout when you add a product to the cart, so in that case, the only possible payment method is selected at that point.
Try to change the "when a product is added to the cart" setting to something else in order to not be redirected to the checkout directly.
That way, when you access the checkout with both products in the cart, it should work fine.

That's however not a foolproof solution so I don't recommend doing that.
A more complex customization of the code of the payment view would be necessary to check each payment method, hide the correct one all the time, and select the only one possible. That will it would work all the time, regardless of how you configure that "when a product is added to the cart" setting or what the customer do. But in that case, it's more complex than a 1 line code modification and will require a developer to spend some time customizing the code for you.

I don't see how changing something in the warehouse would do the trick though.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI5LXBheW1lbnQtbWV0aG9kcy84Nzc5MDYtZm9yY2UtYS1wYXltZW50LW1ldGhvZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.249 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
