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)
-   -   Newest Products (https://forum.x-cart.com/showthread.php?t=1084)

Cankus 07-07-2011 06:14 AM

Re: Newest Products
 
1 Attachment(s)
Yes, it is working but only change

new products_tn.tpl file, please replace attach file on skin/common_files/customer/main

nickff 07-07-2011 06:21 AM

Re: Newest Products
 
Worked perfectly.

Thanks Cankus!!!!

nickff 07-07-2011 06:28 AM

Re: Newest Products
 
Also, you can add the manufacturer into the newproducts.php page by putting this into newproducts.php:

PHP Code:

if (is_array($newproducts)){
foreach(
$newproducts as $k => $v) {
$newproducts[$k]["manufacturer"] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid IN (SELECT manufacturerid FROM $sql_tbl[products] WHERE productid ='$v[productid]')"); }} 


right above:
PHP Code:

# flag set that is used in home_main.tpl
$smarty->assign("main","newproducts"); 


cheers!

adriant 08-09-2011 10:27 PM

Re: Newest Products
 
Quote:

Originally Posted by Cankus
Yes, it is working but only change

new products_tn.tpl file, please replace attach file on skin/common_files/customer/main


Hi Cankus......

Is there a chance that you could make available the whole mod for 4.4 - the code edits, SQL mods and up-to-date files?

I've read through the thread and my head is spinning!?!

I visited your site and the mod looks really good!

many thanks
Adrian

MSfan 03-12-2012 08:34 AM

Re: Newest Products
 
Quote:

Originally Posted by jriggins911
Sidebar from the latest discussion.....

So I have this mod installed and is working fine with one exception.

If I have a product with market price (not the price we are actually selling it for) the market price and the discount (our price vs market price) is not displayed.

For example if on the home page I have a featured product we are selling for $10 dollars with a market price of $20 dollars the selling price of $10, the market price of $20 and a discount of 50% is displayed. However, if the same product is displayed using this mod on the new products page only the $10 price is displayed.

The newest product mod calls all the same templates the featured products and all other category pages call (products.tpl or products_t.tpl) but the output is not the same.

After having parsed through all of the nested template calls I have narrowed it down to a conditional evaluation in products_t.tpl.



The problem here is the returns the appropriate value while returns nothing (as in not even zero). It seems as if the value isn't being passed or made available globally in this "function call".

Since the has no value the entire conditional IF evaluates to false and the market price and discount are not caluculated or displayed.

Since this mod initates the page display from the same template path, customer/home.tpl, and some of the variables are available from the product object ... why does the particular ".list_price" variable (list / market price) not return its' value?

Any ideas? Anyone else have this problem?


Though the post above is over three years old, I encountered this same issue and didn't notice a solution (granted I didn't check all the posts in this thread). Anyway, if anyone still wants to show the market price in addition to the sale price I think I figured out a way.

1. In the file include/func/func.product.php

Look for the following
Code:


    $fields[] = $sql_tbl['products'] . ".productcode";
    $fields[] = $sql_tbl['products'] . ".avail";


and add the following after it:
Code:

   
$fields[] = "$sql_tbl[products].list_price";


2. You will want to open your template file (I'm using the name products_tn.tpl) and write an if statement that compares the list_price to the taxed_price.

Your template code may differ depending on whose recommendation you are trying but look for something like this:
Code:

<tr{interline name=products_matrix} align="center">

        {*Display price/market_price/taxes*}
        {foreach from=$row item=product name=products}
          {if $product}

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

                    <div class="price-row" align="center">
<center>                      <span class="price">{$lng.lbl_our_price}:</span> <span class="price-value">{currency value=$product.taxed_price}</span>
<center>                      <span class="market-price">{alter_currency value=$product.taxed_price}</span>
                    </div>


And add something like this right after it:
Code:

{if $product.list_price gt $product.taxed_price}
    <div class="market-price">
    <span class="market-price-value">Price: {currency value=$product.list_price}</span>
   
{/if}


While I am a programmer, I don't know php at all, so I've stumbled through this. It seems to be working though I haven't throughly tested it. I've modified my X-Cart code a bunch so I don't know how helpful this will be (e.g. your class names/format may be different), but I hope it helps someone. :)

xtech 04-17-2012 10:43 PM

Re: Newest Products
 
Quote:

Originally Posted by Sparks
One more mod to consider that will do the job and has a few customisable templates that you can edit to fit your site.

Newest Added products list for x-cart



Compatible with all version of xcart.. even V3 :D


I have sent you a mail and submit a support ticket about the compatibility of the mod for my x-cart Pro 4.4.2 but got no answer.Pl reply FAST.

Otis 09-24-2012 01:38 PM

Re: Newest Products
 
Can you please tell us how to make this work for xcart gold 4.5.2???


All times are GMT -8. The time now is 09:20 AM.

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