Jump to content

[Resolved] Text separating products


njohn

Recommended Posts

Of course.
 With enough time and ingenuity, America put a man on the Moon. With just a wee bit more, we can put a man on the Sun. (Hee!)

Will this be in the Latest Products, or a Category (includes Search and Saleitems) list?

Either way, CubeCart loads a variable with an array of products to list.
{foreach from=$PRODUCTS item=product}
Then iterates through them.

To have some sort of interstitial, we need to deal with "list mode" and "grid mode".

A grid has three-across, so we can't interrupt the iteration at any arbitrary point.

Smarty has a loop counter. For example:

{foreach from=$PRODUCTS item=product}
  {if $product@iteration is div by 3}
<!-- Stop the list -->
</ul>
<p>Text break</p>
<!-- Resume the list
(be sure to include the attributes
of the previous <ul> tag -->
<ul>
  {/if}
<li>Product Panel:{$product}</li>
{/foreach}

There is slightly more to consider since Foundation uses its "block-grid" feature.

Link to comment
Share on other sites

I understood you wanted interstitial text. The admin, Category, Add/Edit Category, Description tab, Content Editor box is not where this would go.

On a storefront View Category page, you wanted this:

Category Name
Category Description
List of Sub-cats
Sorter (and Pagination)
Product1
Product2
Product3

Interstitial Text (maybe an advert?)

Product4
Product5
Product6
etc.

 

Link to comment
Share on other sites

In the skin template file content.category.php, find near line 65 (for Foundation):

<div id="ccScroll">
   <ul class="small-block-grid-1 product_list" data-equalizer>
      {foreach from=$PRODUCTS item=product}
      <li>

Change to:
<div id="ccScroll">
   <ul class="small-block-grid-1 product_list" data-equalizer>
      {foreach from=$PRODUCTS item=product}

{if $product@iteration is div by 3}
<!-- Stop the list -->
</ul>
<p>Text break</p>
<!-- Resume the list
(be sure to include the attributes
of the previous <ul> tag -->
<ul class="small-block-grid-1 product_list" data-equalizer>
{/if}

      <li>

Have your browser ask for a category page from the storefront. You should now see Text break every so often in the list.

We can adjust the test that determines when and where the interstitial happens.

Link to comment
Share on other sites

You would need to know the category ID of the one category you want this to happen with. For example, when the cat_id is 5.

{if $category.cat_id == 5 && $product@iteration is div by 3}

 

Edited by bsmither
Stupid syntax error
Link to comment
Share on other sites

Very attractive, and I thoroughly enjoyed looking around your store, too. I did notice that the soda can airplanes were extremely light weight - surprised me, as I would expect them to be shipped in a sturdy box with bubble wrap. And the pralines made my mouth water!!

Link to comment
Share on other sites

Yeah, the store owner liked it so much he said put it everywhere sooo: http://natchezshop.com/shop . Originally we were thinking about inserting comments about the people who make that product and I only put that image on the test site to see if an image would work.

The airplane weight was corrected already on the production site

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...