Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

New Attribute (shipping) #4

Open
katgirl opened this issue Jun 18, 2013 · 0 comments
Open

New Attribute (shipping) #4

katgirl opened this issue Jun 18, 2013 · 0 comments

Comments

@katgirl
Copy link

katgirl commented Jun 18, 2013

Have you a shipping by weight, you must send it.

   //Shipping
    $shipping_weight = deserialize($objProduct->shipping_weight);
            $objItem->shipping_weight = $shipping_weight['value'] . ' ' . $shipping_weight['unit'] ;

    if ( (int)$shipping_weight['value'] )
    {
        $objShipping = $this->Database->execute("SELECT * FROM tl_iso_shipping_modules WHERE id IN (".join(",", deserialize($arrConfig['feedShippingModules'])).") AND enabled='1'");
        $arrShipping = array();

        while($objShipping->next())
        {
          $arrCountries = deserialize($objShipping->countries);
          $objShippingOptions = $this->Database->execute("SELECT * FROM tl_iso_shipping_options WHERE pid = '{$objShipping->id}' AND enabled='1' AND (weight_from=0 OR weight_from <= ".$shipping_weight['value'].") AND (weight_to=0 OR weight_to >= ".$shipping_weight['value'].") ORDER BY rate");

          foreach ($arrCountries as $country)
          {
              $arrShipping[$country] = array
              (
                'country' => strtoupper($country),
                'price'   => $objShippingOptions->rate . ' ' . $arrConfig['currency'],
              );
          }
        }

        $objItem->shipping = $arrShipping;
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant