Datafeedr Support Forums

Datafeedr Support Forums (http://www.datafeedr.com/forums/index.php)
-   Questions (http://www.datafeedr.com/forums/forumdisplay.php?f=67)
-   -   Product list with comparison set for each product (http://www.datafeedr.com/forums/showthread.php?t=8808)

theast March 16th, 2013 05:57 AM

Product list with comparison set for each product
 
Hey,

Im trying to list all my products on the store's frontpage, and each product is supposted to have a comparison set. Is this possible?

theast March 16th, 2013 06:27 AM

http://alltomkosttillskott.com/ <- Has exactly what im looking for. Im almost looking for a rip-off about how he presents his products

Eric March 16th, 2013 09:01 AM

Hi,

Welcome to the forums!

Yes, this is possible. First you need to create a comparison set for each of your products. Here's how to do that: http://www.datafeedr.com/videos/?vid...rc=yt#videotop

Then you need to create a new custom view with the name compset. You can do that here: The Factory > Your Store > VIEWS > CUSTOM VIEWS > Add a new view.

In that new compset view add a Comparison set module to the page and add the following code to the template area () of the module:

HTML Code:

<table width="100%">
  [compset.each]
    <tr>
      <td>[product.merchant_logo]</td>
      <td>[product.currency mode='sign'][product.price]</td>
      <td><a href="[product.url]" class="dfbutton dforange dflarge" rel="nofollow">Buy Now</a></td>
    </tr>
  [/compset.each]
</table>

Then go back to your store's front page view: The Factory > Your Store > VIEWS > STORE FRONT PAGE > Default > Product list module and insert the following code where you want your comparison set to appear:

PHP Code:

<?php echo datafeedr_tag('compset?p='.$product->id); ?>

In my example, to get a ballpark layout like the one you linked to, my Product list module on my Store's Front Page view looks like this:

HTML Code:

<div class="pl">
  [product.each]
  <div class="t3 col1">
    <div class="bdr">
      <div class="lc">
        <div class="thmb"><a href="[product.link]" title="[product.name]">[product.image tag='1']</a></div>
        <div class="prc">[product.currency mode='sign'][product.price]</div>
      </div>
      <div class="rc">
        <h2><a href="[product.link]" title="[product.name]">[product.name]</a></h2>
        <div class="desc"><?php echo datafeedr_tag('compset?p='.$product->id); ?></div>
      </div>
      <div class="clearingdiv"> </div>
    </div>
  </div>
  [/product.each]
  <div class="clearingdiv"> </div>
</div>

That worked for me.

Eric

theast March 16th, 2013 09:44 AM

Thanks! It seems to work, only one problem.. The code adds <div>
<div class="modwrp col1">
<div class="modcont" >
<div class="clearingdiv">&nbsp;</div>
</div>
</div>
<div class="clearingdiv">&nbsp;</div>
</div>

Everywhere, any idea how to get rid off it?

Eric March 16th, 2013 09:50 AM

Hi,

Ah yes, forgot that part.

Go here: The Factory > Your Store > VIEWS > CUSTOM VIEWS > compset > View menu > View Properties and check the Don't use layout for this view checkbox.

Save and then click the [Update Settings Only] button.

Eric

theast March 16th, 2013 09:53 AM

And another thing, i dont want to loop all products, because then ill get lots of duplicates. I only want to show the compsets once. Any solution :D?

Eric March 16th, 2013 10:12 AM

Hi,

Yes, go here: The Factory > Your Store > VIEWS > STORE FRONT PAGE > Default > Product list module > Settings ()

Select Use custom query and in the Custom query string field put: compset_status=2

Eric

theast March 16th, 2013 10:24 AM

Thanks! You're awsome.. :D

Eric March 16th, 2013 10:28 AM

You're welcome.

theast March 16th, 2013 01:16 PM

Hey,

I have another question.. On my category page, how do i show only the products in that category? Atm all my products shows up on the category page?

theast March 16th, 2013 01:20 PM

I use custom query :)

Eric March 16th, 2013 02:11 PM

Hi,

That's not quite possible... If you have just a few products in a category you could do what I mentioned here: http://www.datafeedr.com/forums/show...3875#post33875

But it's not possible to do what you did on the store's front page on your category pages. It's an issue with pagination. You can get the page 1 to display but it fails when navigating to page 2, 3, etc...

Eric


All times are GMT -5. The time now is 03:30 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.