Skip to content

Commit b4dc52b

Browse files
authored
Merge pull request #131 from BeAPI/ver/6.9.0
Release 6.9.0
2 parents cd2c54e + 49a940e commit b4dc52b

File tree

9 files changed

+734
-22
lines changed

9 files changed

+734
-22
lines changed

.plugin-data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "6.8.0",
2+
"version": "6.9.0",
33
"slug": "shopping-feed"
44
}

readme.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@
22

33
* Contributors: ShoppingFeed, BeAPI
44
* Tags: shoppingfeed, marketplace, woocommerce, woocommerce shoppingfeed, create woocommerce products shoppingfeed, products feed, generate shoppingfeed, amazon, Jet, Walmart, many marketplace, import orders
5-
* Stable tag: 6.8.0
6-
* Version: 6.8.0
5+
* Stable tag: 6.9.0
6+
* Version: 6.9.0
77
* Requires PHP: 7.3
88
* Requires at least: 5.7
9-
* Tested up to: 6.5
9+
* Tested up to: 6.7
1010
* WC requires at least: 5.1.0
11-
* WC tested up to: 8.8
11+
* WC tested up to: 9.4.3
1212

1313
## Upgrade Notice
1414

1515
> Version 6.0.0 is a major version, there are several changes and improvements which affect the architecture of the plugin. You will have to re-configure the plugin, all the previous settings will be lost
1616
1717
## Changelog
18+
* 6.9.0
19+
* Feed : Fix attributes not use in variations missing in the feed.
20+
* Feed : Dimension data are correctly included in the feed.
21+
* Orders : Fix invalid timestamp when scheduling async task to acknowledge orders.
1822
* 6.8.0
1923
* Feed : Fix the promotion date
2024
* 6.7.0

readme.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
## ShoppingFeed
22
Contributors: ShoppingFeed, BeAPI
33
Tags: shoppingfeed, marketplace, woocommerce, woocommerce shoppingfeed, create woocommerce products shoppingfeed, products feed, generate shoppingfeed, amazon, Jet, Walmart, many marketplace, import orders
4-
Stable tag: 6.8.0
5-
Version: 6.8.0
4+
Stable tag: 6.9.0
5+
Version: 6.9.0
66
Requires PHP: 7.3
77
Requires at least: 5.7
8-
Tested up to: 6.5
8+
Tested up to: 6.7
99
WC requires at least: 5.1.0
10-
WC tested up to: 8.8
10+
WC tested up to: 9.4.3
1111

1212
== Upgrade Notice ==
1313
Version 6.0.0 is a major version, there are several changes and improvements which affect the architecture of the plugin. You will have to re-configure the plugin, all the previous settings will be lost
1414

1515
== Changelog ==
16+
* 6.9.0
17+
* Feed : Fix attributes not use in variations missing in the feed.
18+
* Feed : Dimension data are correctly included in the feed.
19+
* Orders : Fix invalid timestamp when scheduling async task to acknowledge orders.
1620
* 6.8.0
17-
* Feed : Fix the promotion date
21+
* Feed : Fix the promotion date.
1822
* 6.7.0
1923
* Orders : The 'buyer_identification_number' field is imported in an order custom field if it exists.
2024
* Orders : Product updates (price and stock) via the SF API are made asynchronously via a scheduled task.

shoppingfeed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Author URI: https://www.shopping-feed.com/
88
* Text Domain: shopping-feed
99
* Domain Path: /languages
10-
* Version: 6.8.0
10+
* Version: 6.9.0
1111
* Requires at least: 5.7
1212
* Requires PHP: 7.3
1313
* WC requires at least: 5.1.0
@@ -26,7 +26,7 @@
2626
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload.php';
2727
}
2828

29-
define( 'SF_VERSION', '6.8.0' );
29+
define( 'SF_VERSION', '6.9.0' );
3030
define( 'SF_DB_VERSION_SLUG', 'SF_DB_VERSION' );
3131
define( 'SF_DB_VERSION', '1.0.0' );
3232
define( 'SF_UPGRADE_RUNNING', 'SF_UPGRADE_RUNNING' );

src/Feed/Generator.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,23 @@ function (
142142
$product->setWeight( (float) $sf_product->get_weight() );
143143
}
144144

145+
if ( ! empty( $sf_product->get_length() ) ) {
146+
$product->setAttribute( 'length', (string) $sf_product->get_length() );
147+
}
148+
149+
if ( ! empty( $sf_product->get_width() ) ) {
150+
$product->setAttribute( 'width', (string) $sf_product->get_width() );
151+
}
152+
153+
if ( ! empty( $sf_product->get_height() ) ) {
154+
$product->setAttribute( 'height', (string) $sf_product->get_height() );
155+
}
156+
145157
if ( ! empty( $sf_product->get_category_name() ) ) {
146158
$product->setCategory( $sf_product->get_category_name(), $sf_product->get_category_link() );
147159
}
148160

149-
// For variable products, don't include attributes. They will be available in the variations.
150-
if ( ! $sf_product->has_variations() && ! empty( $sf_product->get_attributes() ) ) {
161+
if ( ! empty( $sf_product->get_attributes() ) ) {
151162
$product->setAttributes( $sf_product->get_attributes() );
152163
}
153164

@@ -213,6 +224,15 @@ function (
213224
if ( ! empty( $variation_images ) ) {
214225
$variation->setAdditionalImages( $variation_images );
215226
}
227+
if ( ! empty( $sf_product_variation['width'] ) ) {
228+
$variation->setAttribute( 'width', (string) $sf_product_variation['width'] );
229+
}
230+
if ( ! empty( $sf_product_variation['length'] ) ) {
231+
$variation->setAttribute( 'length', (string) $sf_product_variation['length'] );
232+
}
233+
if ( ! empty( $sf_product_variation['height'] ) ) {
234+
$variation->setAttribute( 'height', (string) $sf_product_variation['height'] );
235+
}
216236
}
217237
}
218238
);

src/Orders/Operations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public static function acknowledge_order( $order_id, $message = '' ) {
205205
if ( false === $ok ) {
206206
//if we cant acknowledge order => add action after 15 min
207207
as_schedule_single_action(
208-
MINUTE_IN_SECONDS * 15,
208+
time() + ( 15 * MINUTE_IN_SECONDS ),
209209
'sf_acknowledge_remain_order',
210210
array(
211211
$order_id,

src/Products/Product.php

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ class Product {
3535
*/
3636
private $weight;
3737

38+
/**
39+
* @var string
40+
*/
41+
private $length;
42+
43+
/**
44+
* @var string
45+
*/
46+
private $width;
47+
48+
/**
49+
* @var string
50+
*/
51+
private $height;
52+
3853
/**
3954
* @var bool|mixed|\WP_Term
4055
*/
@@ -52,6 +67,9 @@ public function __construct( $product ) {
5267
$this->brand = $this->set_brand();
5368
$this->category = $this->set_category();
5469
$this->weight = $this->product->get_weight();
70+
$this->length = $this->product->get_length();
71+
$this->width = $this->product->get_width();
72+
$this->height = $this->product->get_height();
5573
}
5674

5775
/**
@@ -225,6 +243,39 @@ public function get_weight() {
225243
return $this->weight;
226244
}
227245

246+
/**
247+
* @return string
248+
*/
249+
public function get_length() {
250+
if ( empty( $this->length ) ) {
251+
return '';
252+
}
253+
254+
return $this->length;
255+
}
256+
257+
/**
258+
* @return string
259+
*/
260+
public function get_width() {
261+
if ( empty( $this->width ) ) {
262+
return '';
263+
}
264+
265+
return $this->width;
266+
}
267+
268+
/**
269+
* @return string
270+
*/
271+
public function get_height() {
272+
if ( empty( $this->height ) ) {
273+
return '';
274+
}
275+
276+
return $this->height;
277+
}
278+
228279
/**
229280
* @return string
230281
*/
@@ -327,7 +378,15 @@ public function get_attributes() {
327378

328379
$wc_attributes = $this->product->get_attributes();
329380

330-
$attributes = array();
381+
if ( 'variable' === $this->product->get_type() && is_array( $wc_attributes ) && ! empty( $wc_attributes ) ) {
382+
foreach ( $wc_attributes as $key => $attribute ) {
383+
if ( $attribute->get_variation() ) {
384+
unset( $wc_attributes[ $key ] );
385+
}
386+
}
387+
}
388+
389+
$attributes = [];
331390
if ( ! empty( $wc_attributes ) ) {
332391
foreach ( $wc_attributes as $taxonomy => $attribute_obj ) {
333392
$attribute = reset( $attribute_obj );
@@ -415,6 +474,9 @@ public function get_variations( $for_feed = false ) {
415474
$variation_data['quantity'] = $this->_get_quantity( $variation );
416475
$variation_data['price'] = ! is_null( $variation->get_regular_price() ) ? $variation->get_regular_price() : $variation->get_price();
417476
$variation_data['discount'] = $variation->is_on_sale() ? $variation->get_sale_price() : 0;
477+
$variation_data['width'] = $variation->get_width();
478+
$variation_data['height'] = $variation->get_height();
479+
$variation_data['length'] = $variation->get_length();
418480
if ( ! empty( get_the_post_thumbnail_url( $variation->get_id(), 'full' ) ) ) {
419481
$variation_data['image_main'] = get_the_post_thumbnail_url( $variation->get_id(), 'full' );
420482
}

0 commit comments

Comments
 (0)