X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   I admit I'm stomped Featured need help (https://forum.x-cart.com/showthread.php?t=52468)

gizmo 02-22-2010 09:46 AM

I admit I'm stomped Featured need help
 
I cannot work out no matter what I try to surround each featured item within columns on 4.3 version.

I am trying to create a div wrapper around each item and not the whole featured products.

I have determined that below code puts in text, to aid me in the start and end of where each item comes from, but every time I try and wrap it, it wraps in in title only. Any help would be appreciated.

So Below code in red shows text at start of each featured item, but when I try and add or wrap it, it just wraps it around title, it's ok If I leave it as is below.

What on earth am I doing wrong.

CODE SO FAR: In red is where I assume is correct as text shows on individiol items. At the top and bottom

{*
$Id: products_t.tpl,v 1.58 2009/07/08 07:24:45 joy Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{list2matrix assign="products_matrix" assign_width="cell_width" list=$products row_length=$config.Appearance.products_per_row}
{assign var="is_matrix_view" value=true}

{if $products_matrix}

<table cellspacing="3" class="products products-table width-100" summary="{$lng.lbl_products_list|escape}">

{foreach from=$products_matrix item=row name=products_matrix}

<tr{interline name=products_matrix additional_class="product-name-row"}>

{foreach from=$row item=product name=products}
{if $product}

<td{interline name=products additional_class="product-cell"} style="width: {$cell_width}%;"><!--column start -->s
<script type="text/javascript">
<!--
products_data[{$product.productid}] = {ldelim}{rdelim};
-->
</script>
<a href="{$product.alt_url|default:$product.page_url| amp}" class="product-title">{$product.product|escape}</a>
</td>

{/if}
{/foreach}

</tr>

{if $config.Appearance.display_productcode_in_list eq "Y"}
<tr{interline name=products_matrix}>

{foreach from=$row item=product name=products}
{if $product}

<td{interline name=products additional_class="product-cell"}>
{if $product.productcode}
<div class="sku">{$lng.lbl_sku}: {$product.productcode|escape}</div>
{else}
&nbsp;
{/if}
</td>

{/if}
{/foreach}

</tr>
{/if}

<tr{interline name=products_matrix}>

{foreach from=$row item=product name=products}
{if $product}

<td{interline name=products additional_class="product-cell"}>
<div class="image">
<a href="{$product.alt_url|default:$product.page_url| amp}">{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url}</a>

{if $active_modules.Special_Offers && $product.have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl"}
{/if}
</div>
</td>

{/if}
{/foreach}

</tr>

{if $active_modules.Customer_Reviews && $rating_data_exists}
<tr{interline name=products_matrix}>

{foreach from=$row item=product name=products}
{if $product}

<td{interline name=products additional_class="product-cell"}>

{if $product.rating_data}
{include file="modules/Customer_Reviews/vote_bar.tpl" rating=$product.rating_data productid=$product.productid}
{/if}

</td>

{/if}
{/foreach}
</tr>
{/if}

<tr{interline name=products_matrix}>

{foreach from=$row item=product name=products}
{if $product}

<td{interline name=products additional_class="product-cell product-cell-price"}>
{if $product.product_type ne "C"}

{if $active_modules.Subscriptions ne "" && $product.catalogprice}

{include file="modules/Subscriptions/subscription_info_inlist.tpl"}

{elseif $product.appearance.is_auction}

<span class="price">{$lng.lbl_enter_your_price}</span><br />
{$lng.lbl_enter_your_price_note}

{else}

{if $product.appearance.has_price}

<div class="price-row">
<span class="price">{$lng.lbl_our_price}:</span> <span class="price-value">{include file="currency.tpl" value=$product.taxed_price}</span>
<span class="market-price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</span>
</div>

{if $product.appearance.has_market_price && $product.appearance.market_price_discount gt 0}
<div class="market-price">
{$lng.lbl_market_price}: <span class="market-price-value">{include file="currency.tpl" value=$product.list_price}</span>

{if $product.appearance.market_price_discount gt 0}
{if $config.General.alter_currency_symbol ne ""}, {/if}
<span class="price-save">{$product.appearance.market_price_discount}% {$lng.lbl_save_price}</span>
{/if}

</div>
{/if}

{if $product.taxes}
<div class="taxes">{include file="customer/main/taxed_price.tpl" taxes=$product.taxes is_subtax=true}</div>
{/if}

{/if}

{if $active_modules.Special_Offers && $product.use_special_price}
{include file="modules/Special_Offers/customer/product_special_price.tpl"}
{/if}

{/if}

{else}

&nbsp;

{/if}

</td>

{/if}
{/foreach}

</tr>
<tr{interline name=products_matrix}>

{foreach from=$row item=product name=products}
{if $product}

<td{interline name=products additional_class="product-cell product-cell-buynow"}>

{if $active_modules.Product_Configurator and $is_pconf and $current_product}
{include file="modules/Product_Configurator/pconf_add_form.tpl"}
{elseif $config.Appearance.buynow_button_enabled eq "Y" and $product.product_type ne "C"}
{include file="customer/main/buy_now.tpl"}
{else}
&nbsp;
{/if}

END <!--column end --></td>

{/if}
{/foreach}
</tr>
{if $active_modules.Feature_Comparison}
<tr{interline name=products_matrix}>

{foreach from=$row item=product name=products}
{if $product}

<td{interline name=products additional_class="product-cell"}>
{if $product.fclassid gt 0}
<div>{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$product.productid}</div>
{/if}
</td>

{/if}
{/foreach}

</tr>
{/if}
{if !$smarty.foreach.products_matrix.last}
<tr class="separator">
<td colspan="{$config.Appearance.products_per_row|defa ult:1}">&nbsp;</td>
</tr>
{/if}

{/foreach}

</table>

{/if}

gizmo 02-24-2010 09:37 AM

Re: I admit I'm stomped Featured need help
 
Come on share your how to before I go mad.....

ARW VISIONS 02-24-2010 01:35 PM

Re: I admit I'm stomped Featured need help
 
do you mean put a border around each product?

gizmo 02-24-2010 01:45 PM

Re: I admit I'm stomped Featured need help
 
Quote:

Originally Posted by Ashley
do you mean put a border around each product?



Well in short yes, I would like to in "column view" create my own design for each product featured, and use a wrapper or something, instead of using a table as x-cart does, so in short if possible contain each product. yes ash

Featured product List I think I can get my head around that but haven't tried yet.

ARW VISIONS 02-24-2010 04:29 PM

Re: I admit I'm stomped Featured need help
 
This is rather difficult to accomplish and keep things organized the way they have it.

The new template is designed to keep things in nice neat rows.

So the title is on it's own row, the image is on its own row and the button is onit's own row.

The ting you will need to do is change classes to be unique per row, and then style the CSS per row.

I'ts a pain.

cflsystems 02-24-2010 05:51 PM

Re: I admit I'm stomped Featured need help
 
Get rid of the table all together. Use divs and css. Is not that difficult when you break it into its elements. I will share mine with you just keep in mind is from 4.2.1 - use it as a guide only. I don't know why QT insist of using tables

Code:

{*
$Id: products_t.tpl,v 1.46 2008/12/10 08:29:52 max Exp $
vim: set ts=2 sw=2 sts=2 et:
CFL Systems file to replace products_t.tpl
*}
{if $main eq "catalog" && $current_category.category eq ""}
 {list2matrix assign="products_matrix" assign_width="cell_width" list=$products row_length="4"}
{else}
 {list2matrix assign="products_matrix" assign_width="cell_width" list=$products row_length=$config.Appearance.products_per_row}
{/if}
{assign var="is_matrix_view" value=true}
{if $products_matrix}
 {foreach from=$products_matrix item=row name=products_matrix}
  {foreach from=$row item=product}
  {if $product}
    <div class="prod_box">
    <div class="top_prod_box"></div>
    <div class="center_prod_box">
      <div class="product_title">
      <a href="product.php?productid={$product.productid}&amp;cat={$cat}&amp;page={$navigation_page}" title="{$product.product|escape} by CFL Systems">{$product.product|escape}</a>
      </div>
 
      <div class="product_img">
      <a href="product.php?productid={$product.productid}&amp;cat={$cat}&amp;page={$navigation_page}" title="{$product.product|escape} by CFL Systems">{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url}</a>
      </div>
 
      <div class="prod_price">
      {if $product.product_type ne "C"}
        {if $active_modules.Subscriptions ne "" && $product.catalogprice}
        {include file="modules/Subscriptions/subscription_info_inlist.tpl"}
        {elseif $product.appearance.is_auction}
        <span class="price">{$lng.lbl_enter_your_price}</span><br />
        {$lng.lbl_enter_your_price_note}
        {else}
        {if $product.appearance.has_price}
          <span class="price-text">{if $product.is_variants}{$lng.lbl_priced_from}:{else}{$lng.lbl_our_price}:{/if}</span> <span class="price-value">{include file="currency.tpl" value=$product.taxed_price}</span>
          <span class="market-price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</span>
 
          {if $product.appearance.has_market_price && $product.appearance.market_price_discount gt 0}
          <div class="market-price">{$lng.lbl_market_price}: <span class="market-price-value">{include file="currency.tpl" value=$product.list_price}</span>
            {if $product.appearance.market_price_discount gt 0}
            {if $config.General.alter_currency_symbol ne ""}, {/if}
            <p class="price-save">{$product.appearance.market_price_discount}% {$lng.lbl_save_price}</p>
            {/if}
          </div>
          {/if}
 
          {if $product.taxes}
          <div class="taxes">{include file="customer/main/taxed_price.tpl" taxes=$product.taxes is_subtax=true}</div>
          {/if}
        {/if}
 
        {if $active_modules.Special_Offers && $product.use_special_price}
          {include file="modules/Special_Offers/customer/product_special_price.tpl"}
        {/if}
        {/if}
      {else}
        &nbsp;
      {/if}
 
      </div>
 
    </div>
    <div class="bottom_prod_box"></div>
    <div class="prod_details_tab">
      {if $config.Appearance.buynow_button_enabled eq "Y"}
      {include file="customer/main/buy_now.tpl"}
      {/if}
      {if $config.Appearance.display_productcode_in_list eq "Y" && $product.productcode}
      <div class="sku">{$product.productcode|escape}</div>
      {/if}     
      <a href="product.php?productid={$product.productid}&amp;cat={$cat}&amp;page={$navigation_page}" class="prod_details" title="See more details about {$product.product|escape} by CFL Systems">{$lng.lbl_see_details}</a>
      <div class="clearing"></div>
    </div>
    </div>
  {/if}
  {/foreach}
  <div class="clearleft"></div>
 {/foreach}
{/if}


ARW VISIONS 02-24-2010 06:10 PM

Re: I admit I'm stomped Featured need help
 
I don't totally hate tables, they ahve their place. But I agree the products_t.tpl is a mess :(

cflsystems 02-24-2010 06:37 PM

Re: I admit I'm stomped Featured need help
 
Yes they do, I use then but ... the tableless 4.2-4.3 design is full of them. This is what I don't get

gizmo 02-25-2010 05:54 AM

Re: I admit I'm stomped Featured need help
 
cflsystems

I did try and strip the table, but still it would not display properly, here is all the code again, Obviously this is for 4.3.1

And Tables, yea use them still, (If you really have to for complicated tables where it's needed for data etc) but not for what this page is calling it's a mess.

Code:

{*
$Id: products_t.tpl,v 1.58 2009/07/08 07:24:45 joy Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{list2matrix assign="products_matrix" assign_width="cell_width" list=$products row_length=$config.Appearance.products_per_row}
{assign var="is_matrix_view" value=true}

{if $products_matrix}

  <table cellspacing="3" class="products products-table width-100" summary="{$lng.lbl_products_list|escape}">

    {foreach from=$products_matrix item=row name=products_matrix}

      <tr{interline name=products_matrix additional_class="product-name-row"}>

        {foreach from=$row item=product name=products}
          {if $product}

            <td{interline name=products additional_class="product-cell"} style="width: {$cell_width}%;"><!--columb start -->s
<script type="text/javascript">
<!--
products_data[{$product.productid}] = {ldelim}{rdelim};
-->
</script>
              <a href="{$product.alt_url|default:$product.page_url|amp}" class="product-title">{$product.product|escape}</a>
            </td>

          {/if}
        {/foreach}

      </tr>

      {if $config.Appearance.display_productcode_in_list eq "Y"}
        <tr{interline name=products_matrix}>

          {foreach from=$row item=product name=products}
            {if $product}

              <td{interline name=products additional_class="product-cell"}>
                {if $product.productcode}
                  <div class="sku">{$lng.lbl_sku}: {$product.productcode|escape}</div>
                {else}
                    &nbsp;
                {/if}
              </td>

            {/if}
          {/foreach}

        </tr>
      {/if}

      <tr{interline name=products_matrix}>

      {foreach from=$row item=product name=products}
          {if $product}

            <td{interline name=products additional_class="product-cell"}>
              <div class="image">
                <a href="{$product.alt_url|default:$product.page_url|amp}">{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url}</a>

                {if $active_modules.Special_Offers && $product.have_offers}
                  {include file="modules/Special_Offers/customer/product_offer_thumb.tpl"}
                {/if}
              </div>
            </td>

          {/if}
        {/foreach}

      </tr>

      {if $active_modules.Customer_Reviews && $rating_data_exists}
      <tr{interline name=products_matrix}>

        {foreach from=$row item=product name=products}
          {if $product}

            <td{interline name=products additional_class="product-cell"}>

              {if $product.rating_data}
                {include file="modules/Customer_Reviews/vote_bar.tpl" rating=$product.rating_data productid=$product.productid}
              {/if}

            </td>
 
          {/if}
        {/foreach}
      </tr>
      {/if}

      <tr{interline name=products_matrix}>

        {foreach from=$row item=product name=products}
          {if $product}

            <td{interline name=products additional_class="product-cell product-cell-price"}>
              {if $product.product_type ne "C"}

                {if $active_modules.Subscriptions ne "" && $product.catalogprice}

                  {include file="modules/Subscriptions/subscription_info_inlist.tpl"}

                {elseif $product.appearance.is_auction}

                  <span class="price">{$lng.lbl_enter_your_price}</span><br />
                  {$lng.lbl_enter_your_price_note}

                {else}

                  {if $product.appearance.has_price}

                    <div class="price-row">
                      <span class="price">{$lng.lbl_our_price}:</span> <span class="price-value">{include file="currency.tpl" value=$product.taxed_price}</span>
                      <span class="market-price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</span>
                    </div>

                    {if $product.appearance.has_market_price && $product.appearance.market_price_discount gt 0}
                      <div class="market-price">
                        {$lng.lbl_market_price}: <span class="market-price-value">{include file="currency.tpl" value=$product.list_price}</span>

                        {if $product.appearance.market_price_discount gt 0}
                          {if $config.General.alter_currency_symbol ne ""}, {/if}
                          <span class="price-save">{$product.appearance.market_price_discount}% {$lng.lbl_save_price}</span>
                        {/if}

                      </div>
                    {/if}

                    {if $product.taxes}
                      <div class="taxes">{include file="customer/main/taxed_price.tpl" taxes=$product.taxes is_subtax=true}</div>
                    {/if}

                  {/if}

                  {if $active_modules.Special_Offers && $product.use_special_price}
                    {include file="modules/Special_Offers/customer/product_special_price.tpl"}
                  {/if}

                {/if}

              {else}

                &nbsp;

              {/if}

            </td>

          {/if}
        {/foreach}

      </tr>
      <tr{interline name=products_matrix}>

        {foreach from=$row item=product name=products}
          {if $product}

            <td{interline name=products additional_class="product-cell product-cell-buynow"}>

                {if $active_modules.Product_Configurator and $is_pconf and $current_product}
                  {include file="modules/Product_Configurator/pconf_add_form.tpl"}
                {elseif $config.Appearance.buynow_button_enabled eq "Y" and $product.product_type ne "C"}
                  {include file="customer/main/buy_now.tpl"}
                {else}
                  &nbsp;
                {/if}

          END <!--columb end --></td>

          {/if}
        {/foreach}
      </tr>
      {if $active_modules.Feature_Comparison}
      <tr{interline name=products_matrix}>

        {foreach from=$row item=product name=products}
          {if $product}

            <td{interline name=products additional_class="product-cell"}>
              {if $product.fclassid gt 0}
                <div>{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$product.productid}</div>
              {/if}
            </td>

          {/if}
        {/foreach}

      </tr>
      {/if}
      {if !$smarty.foreach.products_matrix.last}
        <tr class="separator">
          <td colspan="{$config.Appearance.products_per_row|default:1}">&nbsp;</td>
        </tr>
      {/if}

    {/foreach}

  </table>

{/if}


I tried your code, and it appears ok, All I need to do now is sort out the css divs, to display properly, and sort out where each on it's own featured product is contained!! within columb view

gizmo 02-25-2010 12:01 PM

Re: I admit I'm stomped Featured need help
 
With thanks to cfl, I am now redoing the code as I now undestand the logic behind this mad code. I Think! lol....

I am going to rebuild it with jquerry columns and add an extra wrap, and see how it goes


All times are GMT -8. The time now is 05:12 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.