Plugin Directory

Changeset 3178013


Ignore:
Timestamp:
10/29/2024 01:05:04 PM (17 months ago)
Author:
productfeeder
Message:

Updated to version 3.0.0

Location:
product-feeder
Files:
11 added
3 edited

Legend:

Unmodified
Added
Removed
  • product-feeder/trunk/includes/product-feeder.php

    r3174257 r3178013  
    326326                                        if (($product->get_type() == 'simple' && $Item['VariationID'] == $Item['ProductID']) || in_array($Item['VariationID'], $product->get_children())) {
    327327                                            $variation = wc_get_product($Item['VariationID']);
    328                                             if ($variation instanceof WC_Product) $ItemsToAddToOrder[] = array('Variation' => $variation, 'Quantity' => $Item['Quantity']);
     328                                            if ($variation instanceof WC_Product) $ItemsToAddToOrder[] = array('Variation' => $variation, 'Quantity' => $Item['Quantity'], 'Price' => $Item['Price']);
    329329                                            else $Errors[] = array('Type' => 'VARIATION NOT FOUND', 'Variables' => array('Name' => $Item['Name'], 'Variant' => $Item['Variant'], 'ProductID' => $Item['ProductID'], 'VariationID' => $Item['VariationID']));
    330330                                        }
     
    362362                                            'country'    => $Order['Shipping']['CountryCode']
    363363                                        ), 'shipping');
    364                                         foreach ($ItemsToAddToOrder as $ItemToAddToOrder) $order->add_product($ItemToAddToOrder['Variation'], $ItemToAddToOrder['Quantity']);
     364                                        foreach ($ItemsToAddToOrder as $ItemToAddToOrder) {
     365                                            $order->add_product($ItemToAddToOrder['Variation'], $ItemToAddToOrder['Quantity'], array(
     366                                                'subtotal' => $ItemToAddToOrder['Price'] * $ItemToAddToOrder['Quantity'],
     367                                                'total' => $ItemToAddToOrder['Price'] * $ItemToAddToOrder['Quantity']
     368                                            ));
     369                                        }
    365370                                        $order->calculate_totals();
    366371                                        $order->add_order_note(sprintf(__('Order %s from marketplace %s with a total price of %s is created by Product Feeder through channel %d - %s', 'product-feeder'), $Order['ID'], $JSON['Marketplace']['Name'], strip_tags(wc_price($JSON['Order']['Price']['Amount'], array('currency' => $JSON['Order']['Price']['Currency']))), $JSON['Channel']['ID'], $JSON['Channel']['Name']));
     372                                        $order->add_meta_data('_wc_order_attribution_source_type', 'utm');
     373                                        $order->add_meta_data('_wc_order_attribution_utm_source', $JSON['Marketplace']['Name'].' - Product Feeder');
    367374                                        update_post_meta($OrderID, 'product_feeder_order', $Order['ID']);
    368375                                        update_post_meta($OrderID, 'product_feeder_marketplace', $JSON['Marketplace']['Name']);
    369376                                        $order->update_status($DefaultOrderStatus, '', true);
     377                                        $order->save();
    370378                                        $this->APISuccess(array('OrderID' => $OrderID));
    371379                                    }
     
    461469                                $order->calculate_totals();
    462470                                $order->add_order_note(sprintf(__('Changed order %s from marketplace %s with a total price of %s is synchronized by Product Feeder through channel %d - %s', 'product-feeder'), $OrderID, $JSON['Marketplace']['Name'], strip_tags(wc_price($JSON['Order']['Price']['Amount'], array('currency' => $JSON['Order']['Price']['Currency']))), $JSON['Channel']['ID'], $JSON['Channel']['Name']));
     471                                $order->save();
    463472                            }
    464473                            $this->APISuccess();
     
    489498                            else $order->update_status($RejectedOrderStatuses[0], '', true);
    490499                            $order->add_order_note(sprintf(__('Rejected order %s from marketplace %s is synchronized by Product Feeder through channel %d - %s', 'product-feeder'), $OrderID, $JSON['Marketplace']['Name'], $JSON['Channel']['ID'], $JSON['Channel']['Name']));
     500                            $order->save();
    491501                            $this->APISuccess();
    492502                        }
  • product-feeder/trunk/product-feeder.php

    r3174257 r3178013  
    55    * Plugin URI:       https://product-feeder.com/nl/sources/wordpress-woocommerce
    66    * Description:      Connect with various marketplaces for automated synchronization of products, orders and returns! Try it now at https://product-feeder.com
    7     * Version:          2.6.5
     7    * Version:          3.0.0
    88    * Author:           Product Feeder
    99    * Author URI:       https://product-feeder.com
  • product-feeder/trunk/readme.txt

    r3176732 r3178013  
    55Requires at least: 6.0
    66Tested up to: 6.7
    7 Stable tag: 2.6.5
     7Stable tag: 3.0.0
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    165165= 2.6.5 =
    166166* Updated order handling for simple product
     167
     168= 3.0.0 =
     169* Added marketplace pricing and origin
Note: See TracChangeset for help on using the changeset viewer.