Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Alter Data_Feed Output Rate Topic   - - - - -

 
  • strategia
  • Newbie
  • Trial users
  • Join Date: 05-Apr 17
  • 8 posts

Posted 10 July 2018 - 02:54 PM #1

Hi,

i've to add currency to price into data_feed export, how can do it?

Thanks



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11004 posts

Posted 10 July 2018 - 04:28 PM #2

The google price fields already do this for you.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • strategia
  • Newbie
  • Trial users
  • Join Date: 05-Apr 17
  • 8 posts

Posted 10 July 2018 - 04:31 PM #3

My cs-cart version is 4.2.4, i've see the changelog and this featured is added on 4.3.7... the https protocol for the product url and product image url are added on 4.3.10.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11004 posts

Posted 10 July 2018 - 04:43 PM #4

Then suggest you either upgrade to 4.3.7 and then install google_export or work with a developer to add that functionality for you to your version.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18481 posts

Posted 11 July 2018 - 06:05 AM #5

- app/schemas/exim/products.php

 

try to add

'Google price' => array(
    'table' => 'product_prices',
    'db_field' => 'price',
    'process_get' => array('fn_exim_google_export_format_price', '#this', '#key', false, false),
    'export_only' => true,
)

after

        'Exceptions type' => array(
            'db_field' => 'exceptions_type'
        ),

- app/schemas/exim/products.functions.php

 

add to the end of file

function fn_exim_google_export_format_price($product_price, $product_id = 0, $use_discount = false, $include_tax = false)
{
    static $auth;

    if (empty($auth)) {
        $auth = fn_fill_auth();
    }

    $product = fn_get_product_data($product_id, $auth, CART_LANGUAGE, false, false, false, false, false, false, false);

    if ($use_discount) {
        // fn_calculate_cart_content is required to get the correct discounted price
        // with taxes applied, if necessary
        $product['amount'] = 1;
        fn_add_product_to_cart(array(
            fn_generate_cart_id($product_id, array()) => $product
        ), $cart, $auth);
        fn_calculate_cart_content($cart, $auth, 'S', true);
        $product_price = $cart['total'];
        unset($cart);
    } else {
        fn_get_taxed_and_clean_prices($product, $auth);

        if ($include_tax) {
            $product_price = empty($product['taxed_price']) ? $product['price'] : $product['taxed_price'];
        } else {
            $product_price = empty($product['clean_price']) ? $product['price'] : $product['clean_price'];
        }
    }

    $price = fn_format_price($product_price, CART_PRIMARY_CURRENCY, null, false);
    return $price . ' ' . CART_PRIMARY_CURRENCY;
}

- clear cache

 

(!) Not tested, code copied from Google export addon

 

P.S. If you are familiar with hooks, it can be done with the My changes module


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11004 posts

Posted 11 July 2018 - 06:22 PM #6

Is he licensed to use the code from an addon in a future (to him) release? 


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18481 posts

Posted 12 July 2018 - 06:00 AM #7

It should be addressed to CS-Cart license department. If not, the code should be created from scratch. But I think the idea is clear.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.