X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Variant chart in product description. (https://forum.x-cart.com/showthread.php?t=14705)

Jerrad 07-19-2006 11:14 AM

I've just changed (with the help of geckoday) the variant prices so that they are displayed with a comma, instead of a point.

This was done in /skin1/modules/Product_Options/check_options.tpl.
Changing the point on line 276 (price = top+"."+bottom.substr(1,bottom.length) into a comma results in variant prices with a comma.
But that doesn't affect the variant prices in this chart mod.
They still show a point instead of a comma...

Anybody knows where to change this?
Thanks in advance!

kevinbrown04 11-12-2006 12:55 PM

Re: Variant chart in product description.
 
Quote:

Originally Posted by mffowler
I have done this for 4.1.2 and have color swatches and they also change the variant images. Perhaps I will post within the next few days. It's a hack, but it does work.

- Mike

Any chance if a version that works in 4.1.3?

Pretty Please
:)

Kevin

geckoday 11-12-2006 01:41 PM

Re: Variant chart in product description.
 
I believe to change the prices to display correctly with a comma instead of a point when set that way in the admin change {$variants[test].price} to {include file="currency.tpl" value=$variants[test].price}

kevinbrown04 11-13-2006 03:26 AM

Re: Variant chart in product description.
 
Hi
Im tring to show a variants table on the product page. I have added the following code to the skin1/customer/main/product.tpl but it doesnt work. Is there any reason this will not work in 4.1.3. I have tried with no luck.


Code:

{if $variants}
<table cellspacing="1" cellpadding="0" border="0" class="chart" width="75%">
<tr class="chart_head">
        <td>{$lng.lbl_sku}</td>
        <td>{$lng.lbl_description}</td>
        <td>{$lng.lbl_our_price}</td>
</tr>
{section name=test loop=$variants}
<tr class="{cycle values="chart_dark,chart_light"}">
        <td>{$variants[test].productcode}</td>
{foreach item=item key=key from=$variants[test].options}
        <td>{$item.option_name}</td>
{/foreach}
        <td>${$variants[test].price}</td>
</tr>
{/section}
</table>


{/if}

Would really appriciate any help

Regards

Kevin

timbrrr 11-13-2006 08:32 AM

Re: Variant chart in product description.
 
Variant images was mentioned a few posts back... I'm hoping to either figure this out or find a post addressing this.... I would like to have an image box next to the options/variants that would show the variant image (instead of it changing the main image at the top) so that the customer could see what he/she was adding on to the product.
Anyone know of a post regarding this?
In the mean time, I'll keep looking and maybe start tinkering ... wish me luck :)

dalmuti 11-13-2006 09:57 AM

Re: Variant chart in product description.
 
Refer to this thread....you can see it live here: http://www.taigayarns.net Look at a yarn product....you will see the swatch images that I added.

http://forum.x-cart.com/showthread.php?t=25100

Louise

kevinbrown04 11-14-2006 12:23 AM

Re: Variant chart in product description.
 
Hi
Thanks for your replies, but what I am trying to do is show a table with;

SKU, Description and Price

of all variants for a product in a table and display it on skin1/customer/main/product.tpl thats is.

There is a version at the begining of this thread (This code is also at the top of this page in another post by me) that works, but not with 4.1.3.
Could anyone get this to work.
This one is driving me mad!!! :)

Thanks

Kevin

Simon Delicata 12-04-2006 06:42 AM

Re: Variant chart in product description.
 
Here's a version for 4.1.3 that I've modifed for my own benefit. The update excludes from the table, all exceptions that would otherwise be shown. It's not the prettiest code in the world and someone with more tallent could make it a bit slicker....

This goes in to customer/main/product.tpl
Code:

{* Determine if product has variants *}
{if $variants}
    <table class=inlineSpec>

    {* Build table header *}
    <tr class="specHeader">
      <td>{$lng.lbl_sku}</td>

    {* Loop to handle multiple variant names *}
    {foreach from=$product_options item=v}
        {if $v.is_modifier eq ''}<TD>{if $usertype eq "A"}{$v.class}{else}{$v.classtext|default:$v.class}{/if}</TD>{/if}
    {/foreach}
      <td >{$lng.lbl_stock_quantity}</td>
      <td >{$lng.lbl_price}</td>
    </tr>

    {* Build table rows *}


    {foreach item=variant from=$variants}
        {assign var=exception value="0"}

        {foreach key=ExceptionKey item=exceptionList from=$product_options_ex}
            {assign var=found value=0}
            {assign var=total value=0}
            {foreach item=classException from=$exceptionList}
                {math assign=total equation="x + 1" x=$total}
                {foreach name=l1 item=variantOpt from=$variant.options}
                    {if $variantOpt.optionid eq $classException.optionid}{math assign=found equation="x + 1" x=$found}{/if}
                {/foreach}
            {/foreach}
            {if $found eq $total}{assign var=exception value="1"}{/if}

        {/foreach}
        {if $exception ne "1"}

            <tr class="specItemHeader{cycle values="1,2"}">
              <td class=partnumber>{$variant.productcode}</td>

            {* Loop to handle multiple variants *}
            {foreach name=foo item=variantOpt key=key from=$product_options}
                {if $variantOpt.is_modifier eq ''}
                    <TD>
                    {foreach name=bar item=varOpt from=$variant.options}
                        {if $varOpt.classid == $variantOpt.classid}{$varOpt.option_name}{/if}
                    {/foreach}
                    </TD>
                {/if}

            {/foreach}

                <td>{$variant.avail}</td>
                <td>{if $product.planer_show_price eq 'Y' }{include file="currency.tpl" value=$variant.price}{else}{if $login eq ''}Login{else}Not available{/if}{/if}</td>
            </tr>
        {/if}
    {/foreach}
    </table>
{/if}

Some CSS to make it look pretty
Code:

TABLE.inlineSpec TD{
        border: 1px inset;
}
TR.specHeader{
        font-weight: bold;
        BACKGROUND: #EE44EE;
        color: white;
}
TR.specItemHeader1 td{
        BACKGROUND: yellow;
        font-weight: normal;
}
TR.specItemHeader2 td{
        BACKGROUND: lightblue;
        font-weight: normal;
}
TR td.specItemTitle{
        font-weight: bold;
        BACKGROUND: #EEEEEE;
}
TR td.partnumber{
        font-weight: bold;
        BACKGROUND: #EEEEEE;
        white-space: nowrap;
}


andreas04031 12-05-2006 11:03 AM

Re: Variant chart in product description.
 
Simon,
I tried your 4.1.3 version and it shows this
SKU16131 Dark chambray 1000 Not available

... price not availabel although the price is there... any suggestions?
Andy

Simon Delicata 12-08-2006 12:05 AM

Re: Variant chart in product description.
 
Sorry Andy,

Change the line that begins :

<td>{if $product.planer_show_price eq 'Y' }

to read

<td>{include file="currency.tpl" value=$variant.price}</td>

That removes the conditional display of the prices (an internal mod I wrote)


All times are GMT -8. The time now is 01:53 AM.

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