I'm using CartThrob for e-commerce. I need to display a block of content only if the package displayed contains a product with a certain entry_id. I was assuming I could just wrap the block of content in a conditional that checks the included products for an entry_id? The channel entry_id of the product I need to check for is 23.
If possible, I could also use a tip on how to enable shipping only for packages that contain this product with this entry_id.
Here is my main template:
{exp:channel:entries channel="rides" limit="1" dynamic="no" url_title="{segment_3}"}
<main role="main" class="inner-page view">
<p class="read-more"><a href="/pro-rides" class="blue">« Back to Pro Rides</a></p>
<article>
<h2>{title}</h2>
<img src="{ride_img}" alt="{title}, ${ride_price}" />
<p class="lead">Price: ${ride_price}</p>
{if ride_body}
<p>{ride_body}</p>
{if:else}
<p>{ride_excerpt}</p>
{/if}
</article>
<section>
{embed="views/.packages"}
</section>
{/exp:channel:entries}
Here is the embedded packages template:
{exp:channel:entries channel="store_packages" dynamic="no"}
{if related_ride == "{segment_3}"}
<ul>
<li>{title}, {entry_id}: {packages_price} </li>
{!-- check for product entry_id inclusion --}
<li><!-- content displayed conditionally --></li>
{!-- end conditional --}
<li><p class="read-more"><a href="{entry_id_path=checkout/cart}" class="blue">Purchase Ride now »</a></p></li>
</ul>
{/if}
{/exp:channel:entries}