| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Shipping module - Offline and Online Hybrid | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Shipping module - Offline and Online Hybrid
I'm working on a shipping module where part of the system is done using an online API and part using customer entered values.
The shipping API provides service codes for the available delivery services for a particular location and weight but not the prices. I'm entering in prices for each service manually. The logic: In function performRequest for the shipping processor model... 1) Send the package details (collect address, delivery address, weight) to the API 2) An array is created of the returned service codes for the available services 3) Another array is created from the database for all x-cart admin enabled methods for the carrier 4) array_intersect is called on the two arrays to have service codes enabled and available Now the bit I can't get working.. I need to get the shipping prices based on the service codes but also the weight of the item. Normally with the API systems this is calculated and price returned. For offline methods there is this code: Code:
but I can't work out how to feed in my service codes and have values returned based on the weight of the item.
__________________
Core version: 5.5.xx |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Shipping module - Offline and Online Hybrid
In this case findMarkupsByProcessor() is the method that filters rates by weight, amount, etc. It returns only the rates that match the order.
The actual filter logic happens there: \XLite\Model\Repo\Shipping\Markup::addMarkupCondit ion() It adds MySQL conditions that drop non-matching rates from the result.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|||
X-Cart forums © 2001-2020
|