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

#   shipping / payment method conflicts

##

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 9 months ago [\#5786](#5786) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  *[shipping / payment method conflicts](/forum/4-how-to/5786-shipping-payment-method-conflicts#5786 "I have a scenario where certain shipping / payment combinations are invalid. Ideally would like to see a valid payment options parameter against shipping options and corresponding validation as part of the core code. However, in the absence of such have been able to achieve this as follows:  Using following checkout workflow: Have a delivery and installation shipping plug-in which takes a price type parameter of either please quote or price from. If selected certain payment methods become inappropriate until after a quote has been submitted and agreed (e.g. paypal).  Needed to make a simple mod to the step.php template to prevent people jumping ahead in the workflow (in the default template although steps are greyed out they are still clickable links).  Another simple mod to the paypal plug-in makes it unavailable if the delivery and installation shipping option is selected: This works exactly as I want provided that the customer goes through the checkout workflow (both forwards and backwards) in the normal way using the next button or the step links. However, it is still possible for a customer to get into steps 5 / 6 and create the order by playing with the URL.  To prevent this I have been looking at the onBeforeOrderCreate() method for the payment plugin. However, although the shipping method name is provided in $order the shipping parameters are not. Would it be possible to add these details to the $order object please (they are provided when onPaymentDisplay() is called).")* was created by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")*

I have a scenario where certain shipping / payment combinations are invalid. Ideally would like to see a *valid payment options* parameter against shipping options and corresponding validation as part of the core code. However, in the absence of such have been able to achieve this as follows:

Using following checkout workflow:

> cart\_coupon,login,address,shipping,payment,confirm\_cart\_coupon\_status\_fields,end

Have a *delivery and installation* shipping plug-in which takes a price type parameter of either *please quote* or *price from*. If selected certain payment methods become inappropriate until after a quote has been submitted and agreed (e.g. paypal).

Needed to make a simple mod to the *step.php* template to prevent people jumping ahead in the workflow (in the default template although steps are greyed out they are still clickable links).

Another simple mod to the paypal plug-in makes it unavailable if the *delivery and installation* shipping option is selected: Code:

function onPaymentDisplay(&amp;$order,&amp;$methods,&amp;$usable_methods){ switch (@$order-&gt;shipping-&gt;shipping_params-&gt;shipping_price_type) { case 'quote' : case 'from' : return false; default: break; } if(!empty($methods)){ ... etc ...

This works exactly as I want provided that the customer goes through the checkout workflow (both forwards and backwards) in the normal way using the *next* button or the *step* links. However, it is still possible for a customer to get into steps 5 / 6 and create the order by playing with the URL.

To prevent this I have been looking at the *onBeforeOrderCreate()* method for the payment plugin.
However, although the shipping method name is provided in $order the shipping parameters are not.
Would it be possible to add these details to the $order object please (they are provided when *onPaymentDisplay()* is called).

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzU3ODYtc2hpcHBpbmctcGF5bWVudC1tZXRob2QtY29uZmxpY3RzP3RtcGw9bWFya2Rvd24=) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 9 months ago [\#5794](#5794) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: shipping / payment method conflicts](/forum/4-how-to/5786-shipping-payment-method-conflicts#5794 "I have a scenario where certain shipping / payment combinations are invalid. Ideally would like to see a valid payment options parameter against shipping options and corresponding validation as part of the core code. However, in the absence of such have been able to achieve this as follows:  Using following checkout workflow: Have a delivery and installation shipping plug-in which takes a price type parameter of either please quote or price from. If selected certain payment methods become inappropriate until after a quote has been submitted and agreed (e.g. paypal).  Needed to make a simple mod to the step.php template to prevent people jumping ahead in the workflow (in the default template although steps are greyed out they are still clickable links).  Another simple mod to the paypal plug-in makes it unavailable if the delivery and installation shipping option is selected: This works exactly as I want provided that the customer goes through the checkout workflow (both forwards and backwards) in the normal way using the next button or the step links. However, it is still possible for a customer to get into steps 5 / 6 and create the order by playing with the URL.  To prevent this I have been looking at the onBeforeOrderCreate() method for the payment plugin. However, although the shipping method name is provided in $order the shipping parameters are not. Would it be possible to add these details to the $order object please (they are provided when onPaymentDisplay() is called).")*

In the function onBeforeOrderCreate, the variable $order-&gt;cart will be the equivalent of the object $order in the function onPaymentDisplay.

In the function onPaymentDisplay, the $order object is a snapshot of all the information about the current cart. In the function onBeforeOrderCreate, the variable $order is really the data which will be saved in the database by the order class for the order ( the objects inside it are ignored automatically ), and the cart sub object is added to it specifically for such cases where you would need more information.

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

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 9 months ago [\#5803](#5803) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: shipping / payment method conflicts](/forum/4-how-to/5786-shipping-payment-method-conflicts#5803 "I have a scenario where certain shipping / payment combinations are invalid. Ideally would like to see a valid payment options parameter against shipping options and corresponding validation as part of the core code. However, in the absence of such have been able to achieve this as follows:  Using following checkout workflow: Have a delivery and installation shipping plug-in which takes a price type parameter of either please quote or price from. If selected certain payment methods become inappropriate until after a quote has been submitted and agreed (e.g. paypal).  Needed to make a simple mod to the step.php template to prevent people jumping ahead in the workflow (in the default template although steps are greyed out they are still clickable links).  Another simple mod to the paypal plug-in makes it unavailable if the delivery and installation shipping option is selected: This works exactly as I want provided that the customer goes through the checkout workflow (both forwards and backwards) in the normal way using the next button or the step links. However, it is still possible for a customer to get into steps 5 / 6 and create the order by playing with the URL.  To prevent this I have been looking at the onBeforeOrderCreate() method for the payment plugin. However, although the shipping method name is provided in $order the shipping parameters are not. Would it be possible to add these details to the $order object please (they are provided when onPaymentDisplay() is called).")*

Perfect, thanks, I had not drilled down far enough in the variables.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzU3ODYtc2hpcHBpbmctcGF5bWVudC1tZXRob2QtY29uZmxpY3RzP3RtcGw9bWFya2Rvd24=) 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.051 seconds

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