Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Draw attention by Bruce Tucker
Bounty Started worth 50 reputation by Bruce Tucker
edited tags
Link
deleted 96 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

I'm not familiar with Magento API, may be this problem is very easy, but i don't know. Please, help me to fix this!

Store have configurable product, which costs 750 ("base version"), via API iI want to buy configured product, which costs 1500. When I just try to get shoppingCartTotals()shoppingCartTotals(), iI get right prices (with right tax), but when iI try to get shipping and payment methods - prices changing O_O.

  1. Without shipping and payment methods:

    array(3) { [0]=> object(stdClass)#2 (2) { ["title"]=> string(8) "Subtotal" ["amount"]=> float(1500) } [1]=> object(stdClass)#3 (2) { ["title"]=> string(3) "Tax" ["amount"]=> float(300) } [2]=> object(stdClass)#4 (2) { ["title"]=> string(11) "Grand Total" ["amount"]=> float(1500) } }

  2. With shipping and payment methods:

    array(2) { ["shoppingCartPaymentMethod"]=> bool(true) ["shoppingCartShippingMethod"]=> bool(true) } array(4) { [0]=> object(stdClass)#2 (2) { ["title"]=> string(8) "Subtotal" ["amount"]=> float(780) } [1]=> object(stdClass)#3 (2) { ["title"]=> string(3) "Tax" ["amount"]=> float(156) } [2]=> object(stdClass)#4 (2) { ["title"]=> string(40) "Shipping & Handling (Fri frakt - Gratis)" ["amount"]=> float(0) } [3]=> object(stdClass)#5 (2) { ["title"]=> string(11) "Grand Total" ["amount"]=> float(780) } }

    Without shipping and payment methods:
  array(3) {
      [0]=>
      object(stdClass)#2 (2) {
        ["title"]=>
        string(8) "Subtotal"
        ["amount"]=>
        float(1500)
      }
      [1]=>
      object(stdClass)#3 (2) {
        ["title"]=>
        string(3) "Tax"
        ["amount"]=>
        float(300)
      }
      [2]=>
      object(stdClass)#4 (2) {
        ["title"]=>
        string(11) "Grand Total"
        ["amount"]=>
        float(1500)
      }
    }
  1. With shipping and payment methods:
  array(2) {
      ["shoppingCartPaymentMethod"]=>
      bool(true)
      ["shoppingCartShippingMethod"]=>
      bool(true)
    }
    array(4) {
      [0]=>
      object(stdClass)#2 (2) {
        ["title"]=>
        string(8) "Subtotal"
        ["amount"]=>
        float(780)
      }
      [1]=>
      object(stdClass)#3 (2) {
        ["title"]=>
        string(3) "Tax"
        ["amount"]=>
        float(156)
      }
      [2]=>
      object(stdClass)#4 (2) {
        ["title"]=>
        string(40) "Shipping & Handling (Fri frakt - Gratis)"
        ["amount"]=>
        float(0)
      }
      [3]=>
      object(stdClass)#5 (2) {
        ["title"]=>
        string(11) "Grand Total"
        ["amount"]=>
        float(780)
      }
    }

What iam I doing wrong?

I'm not familiar with Magento API, may be this problem is very easy, but i don't know. Please, help me to fix this!

Store have configurable product, which costs 750 ("base version"), via API i want to buy configured product, which costs 1500. When I just try to get shoppingCartTotals(), i get right prices (with right tax), but when i try to get shipping and payment methods - prices changing O_O.

  1. Without shipping and payment methods:

    array(3) { [0]=> object(stdClass)#2 (2) { ["title"]=> string(8) "Subtotal" ["amount"]=> float(1500) } [1]=> object(stdClass)#3 (2) { ["title"]=> string(3) "Tax" ["amount"]=> float(300) } [2]=> object(stdClass)#4 (2) { ["title"]=> string(11) "Grand Total" ["amount"]=> float(1500) } }

  2. With shipping and payment methods:

    array(2) { ["shoppingCartPaymentMethod"]=> bool(true) ["shoppingCartShippingMethod"]=> bool(true) } array(4) { [0]=> object(stdClass)#2 (2) { ["title"]=> string(8) "Subtotal" ["amount"]=> float(780) } [1]=> object(stdClass)#3 (2) { ["title"]=> string(3) "Tax" ["amount"]=> float(156) } [2]=> object(stdClass)#4 (2) { ["title"]=> string(40) "Shipping & Handling (Fri frakt - Gratis)" ["amount"]=> float(0) } [3]=> object(stdClass)#5 (2) { ["title"]=> string(11) "Grand Total" ["amount"]=> float(780) } }

What i doing wrong?

Store have configurable product, which costs 750 ("base version"), via API I want to buy configured product, which costs 1500. When I just try to get shoppingCartTotals(), I get right prices (with right tax), but when I try to get shipping and payment methods - prices changing.

  1. Without shipping and payment methods:
  array(3) {
      [0]=>
      object(stdClass)#2 (2) {
        ["title"]=>
        string(8) "Subtotal"
        ["amount"]=>
        float(1500)
      }
      [1]=>
      object(stdClass)#3 (2) {
        ["title"]=>
        string(3) "Tax"
        ["amount"]=>
        float(300)
      }
      [2]=>
      object(stdClass)#4 (2) {
        ["title"]=>
        string(11) "Grand Total"
        ["amount"]=>
        float(1500)
      }
    }
  1. With shipping and payment methods:
  array(2) {
      ["shoppingCartPaymentMethod"]=>
      bool(true)
      ["shoppingCartShippingMethod"]=>
      bool(true)
    }
    array(4) {
      [0]=>
      object(stdClass)#2 (2) {
        ["title"]=>
        string(8) "Subtotal"
        ["amount"]=>
        float(780)
      }
      [1]=>
      object(stdClass)#3 (2) {
        ["title"]=>
        string(3) "Tax"
        ["amount"]=>
        float(156)
      }
      [2]=>
      object(stdClass)#4 (2) {
        ["title"]=>
        string(40) "Shipping & Handling (Fri frakt - Gratis)"
        ["amount"]=>
        float(0)
      }
      [3]=>
      object(stdClass)#5 (2) {
        ["title"]=>
        string(11) "Grand Total"
        ["amount"]=>
        float(780)
      }
    }

What am I doing wrong?

Source Link

Incorrect prices in shopping cart via SOAP API v2

I'm not familiar with Magento API, may be this problem is very easy, but i don't know. Please, help me to fix this!

Store have configurable product, which costs 750 ("base version"), via API i want to buy configured product, which costs 1500. When I just try to get shoppingCartTotals(), i get right prices (with right tax), but when i try to get shipping and payment methods - prices changing O_O.

Here is code:

<?php
 
$proxy = new SoapClient('http://example.com/index.php/api/v2_soap/?wsdl');
$sessionId = $proxy->login('ApiUser', 'ApiKey');
 
$quoteId = $proxy->shoppingCartCreate( $sessionId, 3 );
 
/*$customerData = array(
    "firstname" => "-",
    "lastname" => "-",
    "email" => "[email protected]",
    "mode" => "guest",
    "website_id" => "0"
);*/
 
//$proxy->shoppingCartCustomerSet($sessionId, $quoteId, $customerData);
 
$proxy->shoppingCartCustomerAddresses($sessionId, $quoteId, array(array(
    'mode' => 'billing',
    'firstname' => '-',
    'lastname' => '-',
    'street' => '-',
    'city' => '-',
    'region' => '-',
    'postcode' => '-',
    'country_id' => 'UK',
    'telephone' => '-',
    'is_default_billing' => 1
)));
 
$proxy->shoppingCartProductAdd(
    $sessionId,
    $quoteId,
    array(
        array(
            'sku' => '111111',
            'qty' => '1',
            'options' => array(
                array(
                    "key" => 111,
                    "value" => 1212,
                )
            ),
        )
    ),
    3 //storeId
 
);
//Uncomment following lines for price changing
//$result_payment = $proxy->shoppingCartPaymentMethod($sessionId, $quoteId, array('method' => 'checkmo'), 3);
//$result_shipping = $proxy->shoppingCartShippingMethod($sessionId, $quoteId, 'freeshipping_freeshipping', 3);
//echo var_dump(array('shoppingCartPaymentMethod' => $result_payment,'shoppingCartShippingMethod' => $result_shipping)); 
 
//$result = $proxy->shoppingCartInfo($sessionId, $quoteId, 3);
//var_dump($result);
 
$result = $proxy->shoppingCartTotals($sessionId, $quoteId, 3);
var_dump($result);

And here is results:

  1. Without shipping and payment methods:

    array(3) { [0]=> object(stdClass)#2 (2) { ["title"]=> string(8) "Subtotal" ["amount"]=> float(1500) } [1]=> object(stdClass)#3 (2) { ["title"]=> string(3) "Tax" ["amount"]=> float(300) } [2]=> object(stdClass)#4 (2) { ["title"]=> string(11) "Grand Total" ["amount"]=> float(1500) } }

  2. With shipping and payment methods:

    array(2) { ["shoppingCartPaymentMethod"]=> bool(true) ["shoppingCartShippingMethod"]=> bool(true) } array(4) { [0]=> object(stdClass)#2 (2) { ["title"]=> string(8) "Subtotal" ["amount"]=> float(780) } [1]=> object(stdClass)#3 (2) { ["title"]=> string(3) "Tax" ["amount"]=> float(156) } [2]=> object(stdClass)#4 (2) { ["title"]=> string(40) "Shipping & Handling (Fri frakt - Gratis)" ["amount"]=> float(0) } [3]=> object(stdClass)#5 (2) { ["title"]=> string(11) "Grand Total" ["amount"]=> float(780) } }

What i doing wrong?