Add second buy button
-
Hello,
I would like to add a second Buy button so users will have an option between local/international seller. Here’s what I did so far:
Added field in class-shop-page-wp-cmb2.php
$cmb_url->add_field( array( 'name' => esc_html__( 'Product Affiliate URL Secondary', 'cmb2' ), 'id' => $prefix . 'url_secondary', 'type' => 'text_url', ) );
Updated class-shop-page-wp-grid.php:
inwhile ( $shop_page_wp_query->have_posts()
$url_secondary_field = $prefix . 'url_secondary';
if ( ! ( $link = get_post_meta( get_the_ID(), $url_secondary_field, true ) ) ) { $link_secondary = false; }
I noticed that $link_secondary returns null. What else do I need to update for the actual saving?
Thanks a lot.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add second buy button’ is closed to new replies.