Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
fixed empty attribute for variations
Browse files Browse the repository at this point in the history
fix for #369 and #359
possible fix for #370
  • Loading branch information
mephistopheles4 committed Oct 11, 2018
1 parent 29f4895 commit 3db2c10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.php_cs.cache
*.gif
*.gif
.idea
2 changes: 1 addition & 1 deletion src/Hyyan/WPI/Product/Variation.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ protected function copyVariationMetas($from, $to)
$translated = array();
$tax = str_replace('attribute_', '', $key);
foreach ($metas_from[$key] as $termSlug) {
if (pll_is_translated_taxonomy($tax)) {
if (pll_is_translated_taxonomy($tax) && !empty($termSlug)) {
$term = $this->getTermBySlug($tax, $termSlug);
if ($term) {
$term_id = $term->term_id;
Expand Down

0 comments on commit 3db2c10

Please sign in to comment.