Woocommerce Single Product Layout For Different Product types

Hi,

I have more questions about the new Layouts. I have a Woocommerce shop which has three different types of products:

  • Simple products
  • Free Downloads
  • Affiliate / external products

I am building WC Single layouts, but am having trouble with the Add To Cart button in templates available.

Is it possible to assign three different layouts to products, using Conditions to filter the correct layout for the different types of product? If yes, how can I also change the standard Add To Cart button to link respectively to the Download Now or external URL that the standard Woocommerce pages do?

Thanks,
Christopher

Update:
I now have three layouts and all are applied correctly to their respective categories :grinning:

  • Product - Paid Only
  • Product - Free Downloads Only
  • Product - Affiliate Only

However, my remaining problem is the linking. I cannot seem to find the correct dynamic URL to link:

  • Product - Free Downloads Only to the Download Now button to proceed to the free download
  • Product - Affiliate Only to the Woocommerce affiliate link to go to the Amazon product

These layouts are really powerful, but the dynamic bit is taking a bit of time to learn!

Thanks,
Christopher

Hi Christopher,

I have visited your site, and not able to locate the page and the section which you have mentioned in your post. Can you please share the page URL and the specific section where you are getting the problem?
You can also find the details on how you can use the Dynamic Content in this article: https://theme.co/docs/dynamic-content-and-loopers#dynamic-content

Thanks

Hi Tristup,

These are in Pro > Layouts. The layouts are named “Product - Free Downloads Only” and “Product - Affiliate Only”. The correct layouts appear for each type of product, but I cannot get the right dynamic input for the Link URL.

Thanks,
Christopher

Hello Christopher,

For the affiliated product, The default behaviour of this product to go on the external link so that the product can be carted on the external site. I would suggest you to use the button element to achieve this feature at this layout. On the button element, you can render the product external URL by using dynamic content " {{dc:post:meta key="_product_url"}}" .

For your digital downloadable product, The default behaviour is to add to cart the product and then go to checkout and place order. After the order is been placed then the customer gets a link to download the product in the email. In case if you want to bypass this process you can simply add our button element. On the button, you can render the product meta link by the help of dynamic content so that the user can download the Mp3 or video files or any digital content that you have added in your product.

Hope it helps
Thanks

Hello Prakash,

Thank you very much for the guidance. The external product is now fixed and works as planned.

However, I am still a little stuck with the free digital downloadable product. To re-emphasise, these are free products and so naturally bypass the basket and checkout in out of the box Woocommerce. Are you able to give me the dynamic {{dc…}} code to allow the button to go straight to the download process?

Many thanks,
Christopher

Hi Christopher,

Regretfully, there is no such option available with the Dynamic Content tags to directly connect to the download process. What you are expecting would required customization which is beyond the scope of theme support.

Thanks

@cdnwhite, I’d install ACF Pro and add a file URL field to products. Then call this field dynamically from the button.

Hi Tristup,

Thank you for the help and guidance. I have found a solution which works, though not my ideal one. I had hoped to use the third party plugin “Free Downloads WooCommerce Pro” to bypass the checkout process and which works perfectly with standard Woocommerce templates, but not with the Pro Layouts - to be expected (the plugin was not active during this support case)!

@Misho, thanks for the suggestion - a good one!

Many thanks,
Christopher

1 Like

Glad to hear you found a solution, Christopher, and thanks for chipping in with a suggestion, @Misho!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.