File tree Expand file tree Collapse file tree 1 file changed +39
-6
lines changed Expand file tree Collapse file tree 1 file changed +39
-6
lines changed Original file line number Diff line number Diff line change @@ -644,6 +644,7 @@ public function setPlace($attributes = [])
644
644
645
645
/**
646
646
* Set product properties.
647
+ * Reference: https://developers.facebook.com/docs/marketing-api/catalog/reference/#example-feeds
647
648
*
648
649
* @param array $attributes opengraph product attributes
649
650
*
@@ -652,25 +653,57 @@ public function setPlace($attributes = [])
652
653
public function setProduct ($ attributes = [])
653
654
{
654
655
$ validkeys = [
656
+ // Required
657
+ 'brand ' ,
658
+ 'availability ' ,
659
+ 'condition ' ,
660
+
661
+ // Conditionally required
662
+ 'locale ' ,
663
+ 'plural_title ' ,
664
+
665
+ // Conditionally required: https://developers.facebook.com/docs/payments/product/
666
+ 'price:amount ' , // Required if Static Pricing & not Dynamic Pricing
667
+ 'price:currency ' , // Required if Static Pricing & not Dynamic Pricing
668
+
669
+ // Optional
670
+ 'catalog_id ' ,
671
+ 'item_group_id ' ,
672
+ 'category ' ,
673
+ 'gender ' ,
674
+ 'gtin ' ,
675
+ 'isbn ' ,
676
+ 'mfr_part_no ' ,
677
+
678
+ 'sale_price:amount ' ,
679
+ 'sale_price:currency ' ,
680
+ 'sale_price_dates:start ' ,
681
+ 'sale_price_dates:end ' ,
682
+
683
+
684
+ // Optional - extra
685
+ 'custom_label_0 ' ,
686
+ 'custom_label_1 ' ,
687
+ 'custom_label_2 ' ,
688
+ 'custom_label_3 ' ,
689
+ 'custom_label_4 ' ,
690
+
691
+
692
+ // Deprecated
655
693
'original_price:amount ' ,
656
694
'original_price:currency ' ,
657
695
'pretax_price:amount ' ,
658
696
'pretax_price:currency ' ,
659
- 'price:amount ' ,
660
- 'price:currency ' ,
661
697
'shipping_cost:amount ' ,
662
698
'shipping_cost:currency ' ,
663
699
'weight:value ' ,
664
700
'weight:units ' ,
665
701
'shipping_weight:value ' ,
666
702
'shipping_weight:units ' ,
667
- 'sale_price:amount ' ,
668
- 'sale_price:currency ' ,
669
- 'sale_price_dates:start ' ,
670
- 'sale_price_dates:end '
671
703
];
672
704
673
705
$ this ->setProperties ('product ' , 'productProperties ' , $ attributes , $ validkeys );
706
+
674
707
return $ this ;
675
708
}
676
709
You can’t perform that action at this time.
0 commit comments