Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Newest Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #311  
Old 07-07-2011, 06:14 AM
 
Cankus Cankus is offline
 

Member
  
Join Date: May 2006
Posts: 27
 

Default Re: Newest Products

Yes, it is working but only change

new products_tn.tpl file, please replace attach file on skin/common_files/customer/main
Attached Files
File Type: tpl products_tn.tpl (4.8 KB, 272 views)
__________________
www.elitmarket.com
Pro 4.4.3
Reply With Quote

The following 2 users thank Cankus for this useful post:
admin@digitalpaperpress.c (07-11-2011), nickff (07-07-2011)
  #312  
Old 07-07-2011, 06:21 AM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default Re: Newest Products

Worked perfectly.

Thanks Cankus!!!!
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
Reply With Quote
  #313  
Old 07-07-2011, 06:28 AM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default 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!
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
Reply With Quote
  #314  
Old 08-09-2011, 10:27 PM
 
adriant adriant is offline
 

Senior Member
  
Join Date: May 2006
Posts: 190
 

Default 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
__________________
Xcart gold Plus V4.7.12
REBoot(REdux)

https://www.serpro.co.uk
Reply With Quote
  #315  
Old 03-12-2012, 08:34 AM
 
MSfan MSfan is offline
 

Advanced Member
  
Join Date: Nov 2011
Posts: 56
 

Default 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.
__________________
v4.4.4 Pro
Reply With Quote
  #316  
Old 04-17-2012, 10:43 PM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default 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

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.
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #317  
Old 09-24-2012, 01:38 PM
 
Otis Otis is offline
 

Newbie
  
Join Date: Feb 2007
Posts: 8
 

Default Re: Newest Products

Can you please tell us how to make this work for xcart gold 4.5.2???
__________________
4.5.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020