Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Force A Shipping Method Based On Ip Address At Checkout Rate Topic   - - - - -

 
  • jt_shop
  • Junior Member
  • Members
  • Join Date: 13-Mar 11
  • 12 posts

Posted 12 January 2018 - 02:25 PM #1

Hey,

 

We have a physical shop and we track every order through CS Cart. We have a payment method so people can pay in cash - this way they don't have to pay any shipping fees.

 

We're making a change in how we work - customers can get customer cards, which automatically sign them in so their order is linked to their account (previously, we used just 1 account for this).

 

We need a way to force the 'cash' shipping method when we're logged in the physical shop - for that, we have an IP. Only if a order is made from that certain IP address, there should be no shipping fees.

 

My question is basically one of these: how can I force a shipping method at checkout (even if the user cannot technically use it) or how can I set shipping fees at €0 when ordering from a specific IP address?

 

Thanks in advance :)

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10440 posts

Posted 13 January 2018 - 08:38 PM #2

You can do either method by using the PHP shipping hooks.  You can either return only one shipping method based on your condition or you can set the "free shipping" flag for the items in the order.  It is custom development, there are not administrative methods to do so.  I don't believe IP address is a supported condition in promotions.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17068 posts

Posted 15 January 2018 - 05:59 AM #3

Is there any way to create additional account which can be used from this IP?


CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.

CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jt_shop
  • Junior Member
  • Members
  • Join Date: 13-Mar 11
  • 12 posts

Posted 15 January 2018 - 06:46 PM #4

You can do either method by using the PHP shipping hooks.  You can either return only one shipping method based on your condition or you can set the "free shipping" flag for the items in the order.  It is custom development, there are not administrative methods to do so.  I don't believe IP address is a supported condition in promotions.

Could you tell me where to look for? I've been puzzling in checkout.php, but since this is something I do for one site I'm not too familiar with how everything works yet.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10440 posts

Posted 15 January 2018 - 08:05 PM #5

Look in app/functions/fn.cart.php.  You might want to use the 'get_shipping_info' hook or the 'get_shipping_info_post' hook depending on the various conditions.  Given your new experience with cs-cart, I'd suggest using the hooks rather than trying to extend promotions.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.