X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   Free "What's New?" X-Cart module released! (https://forum.x-cart.com/showthread.php?t=47502)

Victor D 08-25-2009 06:26 AM

Re: Free "What's New?" X-Cart module released!
 
Quote:

Originally Posted by gotpump
Sorry to add to the question craze. But if I'm updating strictly instock and out of stock lvls using a .csv import it adds all the products to What's New. Is there anyway to disable this from happening?
Thanks again,
NM found a way around it.


You need to prevent import script from changing add_date field in xcart_products table


Quote:

Thanks for the great mod ! Quick question, how can I change the size of the bubble and the font size/type of the text inside? I assume it's in Whats_New.tpl but I don't want to break anything.

lines 33,34 of whats_new.tpl:
Code:

popup_top = round(viewportheight/2) - 23; //23 - half of the height
popup_left = round(viewportwidth/2) - 178;  //178 - half of the width


and lines 85,86
Code:

newdiv.style.height = '36px';
newdiv.style.width = '356px';


You need to change height and width of the background image as well

Add into your css file to change font size/color:
Code:

#bubble{font-size:12px}
#bubble a:link, #bubble a:visited, #bubble a:hover, #bubble a:active{color:#cccccc;}


mrerotic 08-25-2009 06:43 AM

Re: Free "What's New?" X-Cart module released!
 
Victor thank you, what about my posting on the popup bubble issue in IE the whole page just keep resfreshing in IE8.

Thanks man :)

Victor D 08-25-2009 07:00 AM

Re: Free "What's New?" X-Cart module released!
 
Quote:

Originally Posted by mrerotic
Found an issue. When I have just added over 70,000 products at once to the store, I get an error in IE and FF where the popup showing new items since last visited. When I try to click "x" or new products to view them on that small popup window, it just keeps showing the same and never shows the main layout of the site or anything. Also does this mod add alot to the index.php as far as load? Please let me know. Thanks


Did you change it to show products without pagination?
It looks like your PHP is running out of memory trying to display them at once

mrerotic 08-25-2009 07:47 AM

Re: Free "What's New?" X-Cart module released!
 
Victor this happens on the homepage. I'm not displaying any 'whats new' products on the homepage. They are in a category. If you dont mind as well I have the same question as the other who posted in the wrong forum. How can you display a certain number of 'whats new' on the homepage and again maybe from a certain category?

Victor D 08-25-2009 10:55 PM

Re: Free "What's New?" X-Cart module released!
 
to display the first page of new products on the homepage
/modules/Whats_New/module.php
replace
Code:

if ($WhatsNew == "Y"){
    if ($config["Whats_New"]["cheat"]) $products=array();
    include $xcart_dir."/products.php";
    $config["Whats_New"]["products"] = $total_items;
   
    $smarty->clear_assign("f_products");
    $smarty->assign("navigation_script", "home.php?WhatsNew=Y");

    $smarty->clear_assign("sort_fields");
    $smarty->clear_assign("products_sort_url");
    $current_category["category_location"][] = array(func_get_langvar_by_name("lbl_wnmod_title"), "home.php?WhatsNew=Y");
}

with
Code:

if ($WhatsNew == "Y"){
    if ($config["Whats_New"]["cheat"]) $products=array();
    include $xcart_dir."/products.php";
    $config["Whats_New"]["products"] = $total_items;
   
    $smarty->clear_assign("f_products");
    $smarty->assign("navigation_script", "home.php?WhatsNew=Y");

    $smarty->clear_assign("sort_fields");
    $smarty->clear_assign("products_sort_url");
    $current_category["category_location"][] = array(func_get_langvar_by_name("lbl_wnmod_title"), "home.php?WhatsNew=Y");
} elseif ($cat==0){
    if ($config["Whats_New"]["cheat"]) $products=array();
    include $xcart_dir."/products.php";
    $config["Whats_New"]["products"] = $total_items;

    $current_category["category_location"][] = array(func_get_langvar_by_name("lbl_wnmod_title"), "home.php?WhatsNew=Y");
}


and add into your skin1/customer/main/welcome.tpl
Code:

{capture name=dialog}
{include file="customer/main/products.tpl"}
{/capture}
{include file="customer/dialog.tpl" title=$lng.lbl_products content=`$smarty.capture.dialog` products_sort_url="home.php?cat=`$cat`&"}


For a certain category check this post
http://forum.x-cart.com/showpost.php?p=266341&postcount=50

Victor D 08-25-2009 11:00 PM

Re: Free "What's New?" X-Cart module released!
 
Quote:

Originally Posted by mrerotic
Victor this happens on the homepage. I'm not displaying any 'whats new' products on the homepage. They are in a category.


That's right, but when you clicking the bubble it tries to search for all the products since last visit (70000)

Plucky Pear 08-27-2009 02:49 PM

Re: Free "What's New?" X-Cart module released!
 
The code on #55 can I use that to have it on my home page but also still have the category?

Victor D 08-28-2009 05:36 AM

Re: Free "What's New?" X-Cart module released!
 
Quote:

Originally Posted by Plucky Pear
The code on #55 can I use that to have it on my home page but also still have the category?

Yes, it doesn't affect the category. Moreover, if you need to remove category you should take some more actions (described in this thread a few pages ago)

Plucky Pear 08-28-2009 08:21 PM

Re: Free "What's New?" X-Cart module released!
 
Thank you for the great mod! It installed easy and I had no troubles getting it to work. Not really happy that when I add it to the front page it looks like a category page so I think I will take that back off, but other than that it does exactly what it should do. Thank you for making it such a simple and quick install :)

Jayk 08-29-2009 11:23 AM

Re: Free "What's New?" X-Cart module released!
 
I love this module. It's been running great, but I got a couple of SQL errors in the last day or so. Maybe someone could shed a little light on them for me...

Code:

SQL query  : select count(*) from xcart_products where add_date > 1251517824, $Version=0 and add_date < 1251517825
    Error code  : 1064
    Description : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' $Version=0 and add_date < 1251517825' at line 1 Request URI: /product.php
Backtrace:
/xxx/include/func/func.db.php:186
/xxx/include/func/func.db.php:112
/xxx/include/func/func.db.php:357
/xxx/modules/Whats_New/config.php:10
/xxx/init.php:635
/xxx/auth.php:44
/xxx/product.php:38


Thanks,
Jason


All times are GMT -8. The time now is 02:19 PM.

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