• Hi, i’ve purchased the pro version of this plugin and it works really well. I’ve also setup a custom template for the product pages, however I want to ONLY show this template for any products that have a shopify tag that says “request-quote”. Is this possible, if so how?

Viewing 1 replies (of 1 total)
  • Plugin Author andrewmrobbins

    (@andrewmrobbins)

    @singhwise Hey there!

    I don’t currently have conditional templating as a feature, but I can see how it would be useful.

    However if you would like to try customizing things in the meantime, I would suggest grabbing the Post ID inside the template like this:

    `global $post;’

    Then, you can use the internal plugin methods to check for the tag you need like this:

    
    $Tags = WP_Shopify\Factories\DB\Tags_Factory::build();
    $Products = WP_Shopify\Factories\DB\Products_Factory::build();
    
    $product_id = $Products->get_product_ids_from_post_ids(1051203)[0];
    $product_tags = $Tags->get_tags_from_product_id($product_id);
    
    $found = false;
    
    foreach ($product_tags as $tag) {
    
       if ($tag->tag === 'request-quote') {
          $found = true;
       }
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Custom form on product page’ is closed to new replies.