Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions includes/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ public function add_product_variation_edit_fields( $index, $variation_data, $pos
'label' => __( 'Manufacturer Parts Number (MPN)', 'facebook-for-woocommerce' ),
'desc_tip' => true,
'description' => __( 'Manufacturer Parts Number', 'facebook-for-woocommerce' ),
'value' => wc_format_decimal( $fb_mpn ),
'value' => $fb_mpn,
'class' => 'enable-if-sync-enabled',
'wrapper_class' => 'form-row form-full',
)
Expand Down Expand Up @@ -1614,7 +1614,7 @@ public function save_product_variation_edit_fields( $variation_id, $index ) {
$posted_param = 'variable_' . \WC_Facebook_Product::FB_PRODUCT_IMAGE;
$image_url = isset( $_POST[ $posted_param ][ $index ] ) ? esc_url_raw( wp_unslash( $_POST[ $posted_param ][ $index ] ) ) : null;
$posted_param = 'variable_' . \WC_Facebook_Product::FB_PRODUCT_CONDITION;
$image_url = isset( $_POST[ $posted_param ][ $index ] ) ? esc_url_raw( wp_unslash( $_POST[ $posted_param ][ $index ] ) ) : null;
$condition = isset( $_POST[ $posted_param ][ $index ] ) ? esc_url_raw( wp_unslash( $_POST[ $posted_param ][ $index ] ) ) : null;
$posted_param = 'variable_' . \WC_Facebook_Product::FB_PRODUCT_VIDEO;
$video_urls = isset( $_POST[ $posted_param ][ $index ] ) ? esc_url_raw( wp_unslash( $_POST[ $posted_param ][ $index ] ) ) : [];
$posted_param = 'variable_' . \WC_Facebook_Product::FB_PRODUCT_PRICE;
Expand All @@ -1624,6 +1624,7 @@ public function save_product_variation_edit_fields( $variation_id, $index ) {
$variation->update_meta_data( Products::PRODUCT_IMAGE_SOURCE_META_KEY, $image_source );
$variation->update_meta_data( \WC_Facebook_Product::FB_MPN, $fb_mpn );
$variation->update_meta_data( \WC_Facebook_Product::FB_PRODUCT_IMAGE, $image_url );
$variation->update_meta_data( \WC_Facebook_Product::FB_PRODUCT_CONDITION, $condition );
$variation->update_meta_data( \WC_Facebook_Product::FB_PRODUCT_VIDEO, $video_urls );
$variation->update_meta_data( \WC_Facebook_Product::FB_PRODUCT_PRICE, $price );
$variation->save_meta_data();
Expand Down