brazilian shipping rds_correlios

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

brazilian shipping rds_correlios

Postby admin » Wed Sep 11, 2013 5:49 pm

Hello Brazilian friends, if you are using a plugin named rds_correlios, we strongly recommnd this code check in order to get an OPC speed up of 4x to 20x:

search for the function getRsCorreiosResponse( and replace it accordingly:

Code: Select all
//stAn:
    static $_mycache;
    protected function getRsCorreiosResponse(VirtueMartCart $cart, $method, $cart_prices)
    {
        $shipment = new RsCorreios();
        $hash = array($method->cepOrigem,
      $this->getZipCode($cart),
      $this->getOrderWidth($cart),
      $this->getOrderLength($cart),
      $method->formato,
      $method->servico,
      $this->getDeclaredValue($method, $cart_prices),
      $this->getOwnHand($method),
      $this->getDeliveryWarning($method));
      
      $shash = serialize($hash);
      if (!empty(self::$_mycache[$shash]))
      return self::$_mycache[$shash];
      
      $response = $shipment
            ->setCepOrigem($method->cepOrigem)
            ->setCepDestino($this->getZipCode($cart))
            ->setLargura($this->getOrderWidth($cart))
            ->setComprimento($this->getOrderLength($cart))
            ->setAltura($this->getOrderHeight($cart))
            ->setPeso($this->getOrderWeight($cart))
            ->setFormatoDaEncomenda($method->formato)
            ->setServico($method->servico)
            ->setValorDeclarado($this->getDeclaredValue($method, $cart_prices))
            ->setMaoPropria($this->getOwnHand($method))
            ->setAvisoDeRecebimento($this->getDeliveryWarning($method))
            ->dados();
      
      
      self::$_mycache[$shash] = $response;
      
        return $response;
    }


Best regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Return to One Page Checkout for Virtuemart 2