you must login to post
Email Password
Using Playa with BR to get products
Charles Bell Posted: 22 July 2014 01:52 PM   [ Ignore ]
Newbie
Avatar
Rank
Total Posts:  25
Joined  2012-05-11

I’m trying to use the Playa field instead of the BR Products field to relate products to structure entries, I read somewhere that they’re supposed to work well together (Playa/BR) but I’m not really finding any specific examples of using them together.

I can get my Playa field to pull in the BR fields (price, image etc). 

Here is my template code:
(where “associated_products_cp” = Playa field in “my_structure_cannel” entry)
 

{exp:channel:entries channel="my_structure_channel" limit="1" disable="categories|member_data|pagination" cache="yes" refresh="60"}
    
<div class="products">
    
{exp:playa:children field="associated_products_cp" limit="12"}
     {items} 
      
<div class="item">
      
{form_open}
      
<a href="{exp:brilliant_retail:path src='product/{url}'}">
       <
h2>{title}</h2>
       
{exp:brilliant_retail:image src="{image_large}" alt="{title}" width='275' height='149'}
          
<class="price">{price_html}</p>
      </
a>  
      
{form_close}
      
</div>
     
{/items} 
    {
/exp:playa:children}
    
</div><!-- [END] products -->
   
   
{/exp:channel:entries} 

This doesn’t parse any of the BR tags, it just outputs them as text.

Using the BR Products field works just fine like so:

{exp:channel:entries channel="my_structure_channel" limit="1" disable="categories|member_data|pagination" cache="yes" refresh="60"}

    
<div class="products">
    
{associated_products_2 limit="12" random="no"}
     {items} 
      
<div class="item">
      
{form_open}
      
<a href="{exp:brilliant_retail:path src='product/{url}'}">
       <
h2>{exp:snippet total="60"}{title}{/exp:snippet}</h2>
       
{exp:brilliant_retail:image src="{image_large}" alt="{title}" width='275' height='149'}
       
<div class="details">
                          <
class="price">{price_html}</p>
       </
div>
      </
a>
      <
div class="button-set"><class="button" href="{exp:brilliant_retail:path src='product/{url}'}">Add to Cart</a></div>  
      
{form_close}
      
</div>
     
{/items} 
    {
/associated_products_2}
    
</div><!-- [END] products --> 
   
    
{/exp:channel:entries} 

 

Is this possible, or is the only way to do this with the BR Products relationship field?


Thanks for any help!