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)

JWait 08-15-2008 12:50 PM

Re: Newest Products
 
http://forum.x-cart.com/showthread.php?t=1084&page=9 ...... post #90 through about 110

betty4 08-16-2008 12:20 PM

Re: Newest Products
 
Quote:

Originally Posted by JWait


JWait this is your baby and thanks for your reply. I'm using the zip file from post #185. I have already followed all those instructions to the letter, checked and rechecked code additions, position, spelling, and file location. It's really all pretty straight forward. That's the easy part. I'm almost there.

Here lies the root of my problem. Cleared cache, re-booted PC and continue to get blank page calling newsproducts.php. My post #238 was specific to instructions for Edit $xcart_dir/include/func/func.product.php. Store ver. 4.0.17 is not structured that way. File does not exist to edit. I wrote what I did to remedy for my version in this instance and requested feed back for that action.

I wrote I have already searched for an answer to that concern throughout the thread, but could not find any references to mysql function edit for 4.0.17. It could be a combination of incompatible template coding in newproducts.tpl and mysql query functions for the version. I just don't know at this point.

JWait 08-17-2008 05:18 AM

Re: Newest Products
 
1 Attachment(s)
This is not "my baby" but it is a mod that I find necessary to business, and think it should be a part of x-cart by default.

The zip from post #185 is for version 4.1.x (the "Edit $xcart_dir/include/func/func.product.php" is a dead giveaway as it doesn't exist in versions other than 4.1.x) and from my original notes I don't see where any php files are modified anyway.

I have attached the files I used for version 4.0.x (probably version 4.0.19) for you to compare. As I said before this is a old thread, and it has gone through several version of x-cart that are different from one another, so you will have to find where the discussion pertains to your version.

To make matters worse, there are 2 distinctly different mods that pertain to new products, making it difficult if you do a search of this forum. The posts in the thread at http://forum.x-cart.com/showthread.php?t=1084&page=9 ...... post #90 through about 110 appear to deal with your specific version, and would probably be a good starting point.

betty4 08-18-2008 10:53 AM

Re: Newest Products
 
Thank you for the attachment. I agree the mod shoud definately be inherent in the cart package. Sorry if you were offended by the "baby" reference. It was a show of respect honoring your zip file contribution. I'll give the attached 4.0.x zip a try.

betty4 08-18-2008 02:11 PM

Re: Newest Products
 
1 Attachment(s)
Okay. I overwrite newproducts.php file offered for 4.0.x and called it. newproducts.tpl works now and Ive added products in last 3, 7 & 30 days that don't show. Says no new products and got top of page debug error:

Quote:

INVALID SQL: 0 :
SQL QUERY FAILURE: SELECT COUNT(xcart_products.productid) FROM xcart_products, xcart_categories, xcart_products_categories, xcart_pricing WHERE xcart_products.productid=xcart_products_categories .productid AND xcart_products_categories.categoryid=xcart_categor ies.categoryid AND xcart_products.productid=xcart_pricing.productid AND xcart_pricing.quantity=1 AND (xcart_pricing.membership='' OR xcart_pricing.membership='') AND (xcart_categories.membership='' OR xcart_categories.membership='') AND xcart_products.forsale='Y' AND xcart_pricing.variantid = 0AND xcart_products.avail > 0 AND add_date > 1216504439 AND add_date < 1219096439 GROUP BY xcart_products.productid

Thanks.

JWait 08-24-2008 09:15 PM

Re: Newest Products
 
Did you try clearing the variable templates cache?

betty4 08-25-2008 11:53 AM

Re: Newest Products
 
3 Attachment(s)
Quote:

Originally Posted by JWait
Did you try clearing the variable templates cache?


Thanks again for your reply. Yes. I did that today. Cache now contains 0 files so it's clean. Still have INVALID SQL: 0 : pointing to a SELECT COUNT query failure performing FROM, WHERE, AND... top of page and returning "No new products have been listed within timeframe you specified".

Seems to me the query string needs tweaking in this instance. Probably as plain as the nose on my face, but I can't figure it out even with a clear head.

Backtrace : /include/func.php:121 /include/func.php:80 /newproducts.php:143 /newproducts.php:237

See Screenshot

xcell67 09-27-2008 11:45 AM

Re: Newest Products
 
Hi,

I'm using the version that provided the zip :newproducts4-1-x

Problem:
Whenever I do an inventory update of existing items (price, stock,etc) using the import function of X-cart, the add date changes. With the add date changing, the newproducts mod thinks the old item is a new one causing it to pull up every single item when I just wanted the newest products to show.

Anyone else have this problem?

JWait 10-01-2008 04:35 AM

Re: Newest Products
 
Betty, I'm no sql expert, but this (from your error report) looks strange to me...
"... AND (xcart_pricing.membership='' OR xcart_pricing.membership='')...".

Shouldn't the =" actually be ="", or maybe it is just 2 single ' together.

aimeea 10-02-2008 03:38 PM

Re: Newest Products
 
Is there a way to limit the number of new products per manufacturer or provder that shows up on the newest products first page?

Thank you for any help

fafbr 10-31-2008 02:19 AM

Re: Newest Products
 
Hi all8)

Once again, I need your help!!
I am trying to add this mod in my store where I use x cart 4.1.11 version.
I have downloaded post #185 in this thread.
I opened install instructions:


Quote:

Crude install notes
1) You need to edit {xcart_dir}/skin1/customer/home_main.tpl
Add the following lines before the {else} at bottom of file:
{elseif $main eq "newproducts"}
{include file="customer/main/newproducts.tpl"}

2) Copy newproducts.tpl file to {$xcart_dir}/skin1/customer/main/
example: /xcart/skin1/customer/main/newproducts.tpl

3) Copy newproducts.php file to {xcart_dir}/
example: /xcart/newproducts.php

4) Apply the SQL Language file 'language.sql' into the Patch file section
of the X-cart Admin :: Patch/Upgrade center. Or load via mysql

5) You should now be able to put a link using
<domain_name>/{$xcart_dir}/newproducts.php

You can add the link anywhere (speed bar, href, help section, etc).

================================================== =======================
6.
Edit $xcart_dir/skin1/customer/home_main.php
Find:
{else}
{include file="common_templates.tpl"}
{/if}
Insert BEFORE:
{elseif $main eq "newproducts"}
{include file="customer/main/newproducts.tpl"}

================================================== =======================
7.
Edit $xcart_dir/include/func/func.product.php
FIND (approx line 363):
$fields[] = "$sql_tbl[products].productcode";
$fields[] = "$sql_tbl[products].avail";

Add AFTER:
// newproducts .. needed for quantity to work on newproducts module
$fields[] = "$sql_tbl[products].min_amount";

================================================== =======================
8.
Edit $xcart_dir/newproducts.php
FIND (approx line 14)
Adjust the default number of days to search for new products.
The default is 7 days.


And....... I stopped at step 5 of these instructions.:(
It is my first experience with x cart; therefore, excuse-me if step 5 may seem obvious to you and makes my doubt seem too silly :roll:
Could anyone help me and clarify me better where I should add this link and which is correct location for it ?
Please!!
Thank you all in advance !!

JWait 10-31-2008 03:58 AM

Re: Newest Products
 
Well, I put my "new products" link in the speed bar. I also added one below "Gift Certificates" in the section that I renamed "Gift Ideas" (I forget what the default title is.."special", I think), but that involves adding code to the template.

Lingerieblowout 10-31-2008 04:26 AM

Re: Newest Products
 
Where do you want it on you site ? Can't help you unless we know where you want the link shown. : )

fafbr 10-31-2008 05:50 AM

Re: Newest Products
 
Quote:

Originally Posted by Lingerieblowout
Where do you want it on you site ? Can't help you unless we know where you want the link shown. : )

Hi Lingerieblowout
I want in store front, below of welcome

http://www.divinescrap.com/store/home.php

Thank you for help

robertswww 10-31-2008 06:15 AM

Re: Newest Products
 
Quote:

Originally Posted by fafbr
I want in store front, below of welcome

Then just edit the welcome.tpl make your changes and upload the file back to your server.

File location: skin1/customer/main/welcome.tpl

Cheers,

Robert

fafbr 10-31-2008 06:45 AM

Re: Newest Products
 
Quote:

Originally Posted by robertswww
Then just edit the welcome.tpl make your changes and upload the file back to your server.

File location: skin1/customer/main/welcome.tpl

Cheers,

Robert

Hi Robert
How to I put the link in step 5 in skin1/customer/main/welcome.tpl?
This is my welcome .tpl below
Quote:

{* $Id: welcome.tpl,v 1.28.2.3 2008/07/15 12:07:40 ferz Exp $ *}
{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
{assign var="_name" value=$smarty.cookies.GreetingCookie|replace:"\'": "'"}
<h3>{$lng.lbl_welcome_back|substitute:"name":$_nam e} </h3>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng .lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$con fig.Company.company_name}</h3>
{/if}
{$lng.txt_welcome}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<br />
{include file="customer/main/featured.tpl" f_products=$f_products}


Thank you for your help:oops:

robertswww 10-31-2008 09:45 AM

Re: Newest Products
 
Quote:

Originally Posted by fafbr
Hi Robert
How to I put the link in step 5 in skin1/customer/main/welcome.tpl?

Hi Faf,

It's up to you were you would like to put it, but try this to get you started...

Code:

{* $Id: welcome.tpl,v 1.28.2.3 2008/07/15 12:07:40 ferz Exp $ *}
{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
{assign var="_name" value=$smarty.cookies.GreetingCookie|replace:"\'": "'"}
<h3>{$lng.lbl_welcome_back|substitute:"name":$_nam e} </h3>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng .lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$con fig.Company.company_name}</h3>
{/if}
{$lng.txt_welcome}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}

{* NOTE - Custom MOD - Add Newest Products Link Below *}
<p />
http://www.divinescrap.com/{$xcart_dir}/newproducts.php

<br />
{include file="customer/main/featured.tpl" f_products=$f_products}


Robert

fafbr 10-31-2008 11:07 AM

Re: Newest Products
 
Quote:

Originally Posted by robertswww
Hi Faf,

It's up to you were you would like to put it, but try this to get you started...

Code:

{* $Id: welcome.tpl,v 1.28.2.3 2008/07/15 12:07:40 ferz Exp $ *}
{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
{assign var="_name" value=$smarty.cookies.GreetingCookie|replace:"\'": "'"}
<h3>{$lng.lbl_welcome_back|substitute:"name":$_nam e} </h3>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng .lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$con fig.Company.company_name}</h3>
{/if}
{$lng.txt_welcome}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
 
{* NOTE - Custom MOD - Add Newest Products Link Below *}
<p />
http://www.divinescrap.com/{$xcart_dir}/newproducts.php
 
<br />
{include file="customer/main/featured.tpl" f_products=$f_products}


Robert

Hi Robert

Thank you for your try and help.
But it did not worked.
Only the link .php was displayed in welcome.
Anyway I thank you very much for your attention.:wink:
Cheers
Faf

robertswww 10-31-2008 11:35 AM

Re: Newest Products
 
Hey Faf,

I don't use this particular free mod, but I use a paid version instead, so I can't really check it out for you, but you must be missing one of the steps...

Especially verify STEP 3:

Copy newproducts.php file to {xcart_dir}/
Example: /store/newproducts.php

And Verify STEP 5:

Edit: store/skin1/customer/home_main.php

{elseif $main eq "newproducts"}
{include file="customer/main/newproducts.tpl"}
{else}
{include file="common_templates.tpl"}
{/if}

Good Luck!

Robert

Lingerieblowout 10-31-2008 12:11 PM

Re: Newest Products
 
This free mod allow a link on your site to navigate to the newproducts page. The paid version put the products on your home page

jriggins911 10-31-2008 09:23 PM

Re: Newest Products
 
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.

Quote:

{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0 }
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}
{/if}

The problem here is the
Quote:

$products[product].taxed_price
returns the appropriate value while
Quote:

$products[product].list_price
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
Quote:

$products[product].list_price
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?

JWait 11-01-2008 04:54 PM

Re: Newest Products
 
I tried making a new product with a higher market price and as you said the market price did not display. The selling price did however. I think no one has experienced this problem because the items included are new items and not usually on sale lower than the initial price set when they were added.

jriggins911 11-02-2008 12:38 PM

Re: Newest Products
 
Well that is a good confirmation that the "problem" extends beyond just our setup. I still have not made any break throughs as to why $products[product].list_price doesn't return its value...

aimeea 11-07-2008 07:38 AM

Re: Newest Products
 
Is it possible to have this run in a column on a page ouside of xcart?

I would like to have column in our community that shows our new products.

Thank you in advance

chrisdurnan 12-05-2008 01:03 PM

Re: Newest Products
 
Is there somewhere that sells this modification that I could have it installed. I am not experienced enough to tinker around with coding etc and would be more interested in paying someone. I looked through a few online stores and couldn't find anything. Any thoughts or direction are appreciated.

Thanks
Chris

Lingerieblowout 12-05-2008 01:06 PM

Re: Newest Products
 
I PM you Chris

robertswww 12-05-2008 01:47 PM

Re: Newest Products
 
Quote:

Originally Posted by chrisdurnan
Is there somewhere that sells this modification that I could have it installed.Thanks
Chris

Hi Chris,

I use the Firetank Sofware version of this MOD and have been very pleased with it. It is fairly simple to install by oneself, but if you want, they can install it for you for an additional $19.95.

Check it out here:
Newest Added products list for x-cart
http://www.firetanksoftware.com/fts/customer/Newest-Added-products-list-for-x-cart-pid-79.html

Robert

chrisdurnan 12-05-2008 01:52 PM

Re: Newest Products
 
Such a quick forum I love it. Thank you. I am preparing my budget for site development in the beginning of next year. This has been helpful.
Thanks
Chris

JWait 12-09-2008 07:44 AM

Re: Newest Products
 
Robertswww, just out of curiosity, since you are you using the Firetank Sofware version of this MOD do you have any errors on the product pages if Recommended Products is enabled?

Lingerieblowout 12-09-2008 08:42 AM

Re: Newest Products
 
Firetank mod has no effect on product pages as his mod is for your home page

JWait 12-09-2008 09:08 AM

Re: Newest Products
 
I don't see it on your home page.

robertswww 12-09-2008 01:35 PM

Re: Newest Products
 
Quote:

Originally Posted by JWait
Robertswww, just out of curiosity, since you are you using the Firetank Sofware version of this MOD do you have any errors on the product pages if Recommended Products is enabled?

Hi JWait,

We do have the Recommended Products Module enabled, and the list displays properly on our Detailed Product Pages (have not seen any errors). There doesn't appear to be any conflict with the Firetank Newest Products MOD and Recommended Products, at least not on our site.

Robert

JWait 12-10-2008 04:16 AM

Re: Newest Products
 
Thanks robertswww.

presson83 03-23-2009 04:33 AM

Re: Newest Products
 
Hi All,

I've tried using the zip file mod with 4.2 to display newest prods on my homepage and thought it was working, but it appears it only displays the products that are defined as "featured products" for some reason. Is this a known issue?

JWait 03-24-2009 04:56 AM

Re: Newest Products
 
Featured products are displayed by default. Do you actually have any new products? If you do not, then that is probably why featured products is displayed.

jriggins911 06-05-2009 01:21 AM

Re: Newest Products
 
Anyone by chance happen to get this mod (post #185 version and X-cart 4.1.9) working with the altered cart On Sale module? More specifically, getting the products that are on sale to show the sale price?

The newproducts mod works but does not show the sale price.

I've played around with it but haven't had any so far.

royng 07-07-2009 01:32 PM

Re: Newest Products
 
I still can't find the home.php file
Can someone post step by stop and files location. Thanks!

royng 07-09-2009 10:49 AM

Re: Newest Products
 
Anyone know where the home.php located?

shipmerchant 07-09-2009 07:29 PM

Re: Newest Products
 
Quote:

Originally Posted by royng
Anyone know where the home.php located?


Its in your root directory;

xcart/home.php

Not really following this thread but be aware that their is also a home.tpl in your
/xcartl/skin1/customer/home.tpl

Hope it helps.

mrerotic 07-21-2009 08:41 PM

Re: Newest Products
 
Does this work yet for version 4.2 ? Would be nice addition if at all possible.


All times are GMT -8. The time now is 10:13 PM.

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