Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How send just 1 geral shipmment to gateway… not 1 for each product…
 
tubadc
Sr. Member
 
Total Posts:  95
Joined:  2008-05-07
Floripa | BR
 

I have fixed shippmnet at $10.

Every time i finish the checkout and im redirect to my paymment gateway its send 1 shippment total for each product so if i send 2 products to gateway its send $10 for each one… total=$20, in my case the right thing is it send $10 total for any number of items in cart… so all the time the ship total should be $10 .... understand me?

here is the code…

public function getStandardCheckoutFormFields()
    
{
        $a 
$this->getQuote()->getShippingAddress();
        
//getQuoteCurrencyCode
        
$currency_code $this->getQuote()->getBaseCurrencyCode();
        
/*
        //we validate currency before sending PagSeguro so following code is obsolete

        if (!in_array($currency_code,$this->_allowCurrencyCode)) {
            //if currency code is not allowed currency code, use USD as default
            $storeCurrency = Mage::getSingleton('directory/currency')
                ->load($this->getQuote()->getStoreCurrencyCode());
            $amount = $storeCurrency->convert($amount, 'USD');
            $currency_code='USD';
        }
        */
        
$shipping sprintf('%.2f'$this->getQuote()->getShippingAddress()->getBaseShippingAmount());
        
        
$sArr = array(
            
'email_cobranca'          => Mage::getStoreConfig('PagSeguro/wps/business_account'),
            
'tipo'                    => 'CP',
            
'return'                    => Mage::getUrl('PagSeguro/standard/success',array('_secure' => true)),
            
'cancel_return'             => Mage::getUrl('PagSeguro/standard/cancel',array('_secure' => false)),
            
'notify_url'                => Mage::getUrl('PagSeguro/standard/ipn'),
            
'ref_transacao'           => $this->getCheckout()->getLastRealOrderId(),
            
'moeda'                      => 'BRL',
            
'address_override'          => 1,
            
'cliente_nome'               => $a->getFirstname()." ".$a->getLastname(),
            
'cliente_end'             => $a->getStreet(1),
            
'cliente_num'             => '',
            
'cliente_bairro'          => '',
            
'cliente_compl'           => $a->getStreet(2),
            
'cliente_cidade'          => $a->getCity(),
            
'cliente_uf'              => $a->getRegionCode(),
            
'cliente_pais'            => 'BRA',
            
'cliente_cep'             => $a->getPostcode(),
            
'cliente_ddd'             => '',
            
'cliente_tel'             => '',
            
'cliente_email'           => $a->getEmail(),
            
'item_frete_1'               => $shipping,
            
        );
 
Magento Community Magento Community
Magento Community
Magento Community
 
tubadc
Sr. Member
 
Total Posts:  95
Joined:  2008-05-07
Floripa | BR
 

either if i try to find the key at array they add it once for each product....

if ($shipping>0{
        
          
if (!array_key_exists("item_frete_1"$sArr)) {
              $sArr 
array_merge($sArr, array(
                    
'item_frete_1' => $shipping,
              ));
         
}        }

how to add just one time???? i need just a fixed ship value add to the whole order, not 1 time for each product...=( help me! tks....

 
Magento Community Magento Community
Magento Community
Magento Community
 
tubadc
Sr. Member
 
Total Posts:  95
Joined:  2008-05-07
Floripa | BR
 

plzzzzz someone helpme....

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top