X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   All Products on front page, similar to featured products (https://forum.x-cart.com/showthread.php?t=69469)

minfinger 06-30-2014 02:46 PM

All Products on front page, similar to featured products
 
I'd like to have all my Available, New, Coming Soon products on the front page similar to featured products look. The only problem is with 1,000+ unique items every year and I can't ask them to add every product to featured products. It's slow and monotonous and they will undoubtedly miss a product.

I'd like to have the 3 column look on the main site and the the single column on the Mobile site.

tony_sologubov 07-01-2014 05:49 AM

Re: All Products on front page, similar to featured products
 
Hi!

You can tick on the Display "New arrivals" block on sidebar (otherwise in center area) and Display "Coming soon" block on sidebar (otherwise in center area) options on the Product Advisor module's settings page and it should do the trick.

minfinger 07-02-2014 09:07 AM

Re: All Products on front page, similar to featured products
 
I will try that.

minfinger 07-04-2014 11:57 AM

Re: All Products on front page, similar to featured products
 
1 Attachment(s)
So I believe I did what you suggested, but the products are only appearing on the left in the sidebar. See pic

tony_sologubov 07-07-2014 02:30 AM

Re: All Products on front page, similar to featured products
 
Sorry, it looks like I missed the point. Do you want to display your Coming soon products in the central area or in the sidebar?

minfinger 07-07-2014 02:48 AM

Re: All Products on front page, similar to featured products
 
I want to display all of my products in the central area. But I wanted them to have the "New", "Coming Soon", & Regular looks.

tony_sologubov 07-07-2014 03:13 AM

Re: All Products on front page, similar to featured products
 
In this case, please try to disable the Display "New arrivals" block on sidebar (otherwise in center area) and Display "Coming soon" block on sidebar (otherwise in center area) options mentioned earlier and let me know if it is what you need.

minfinger 07-07-2014 09:01 AM

Re: All Products on front page, similar to featured products
 
Well that worked, but I don't think it's going to give my client the desired affect. I had to set "Number of days to keep products marked as new arrivals:" to 365. Honestly I could set it to 120 days, but even then I think the problem is going to come when a product either falls outside the 120 day mark or whatever I set it too.

Another thing I notice is that it's 2 separate lists with Coming Soon at the bottom. If he has 150+ Products, like he usually does, in the New Arrivals section, then the Coming soon gets pushed to the bottom. "Out of site out of mind".

I also see another problem with the way New and Coming Soon works. When you go into a product category, it lists all the products in that category, tags them, new/coming soon. Then below that it breaks them up into New and Coming Soon and lists them again. If everything it "New" by placing the 120 day setting, then this really messes with the customer. Because they'll see, for example, 20 products, and then the same 20 products again along with an additional X products in Coming Soon. That seems very redundant. I know this probably works for normal sites that don't have high product turn over.

I think we'd much rather have a complete list on the Front Page with all the products mixed together that also included the "New" and "Coming Soon" tags, which seems to only appear once you view the products in a Category.

We value the potential of the Orange "look here" tags that help with conversion rates. Heck if I could make them flash and dance around I would lol

Do you think you might be able to help me design a module that could work in conjunction with Product Advisor to get the desire "New" & "Coming Soon" products all in one complete list with the tags?

tony_sologubov 07-11-2014 05:01 AM

Re: All Products on front page, similar to featured products
 
Hi!

Yes, absolutely, I will be happy to help you out with it. Just let me know what is the desired result you would like to get.

Tony.

minfinger 07-12-2014 01:03 PM

Re: All Products on front page, similar to featured products
 
1 Attachment(s)
I would like the front page to look similar to this with the different "Classes" of products mixed together. What I mean is, I want All products, new products 30 or less old, and coming soon products.

See pic. If you need a better explanation, let me know.

tony_sologubov 07-14-2014 05:52 AM

Re: All Products on front page, similar to featured products
 
1) Shall we remove current Featured Products section from front-end or we should simply populate it with the products you need?
2) How these products should be sorted in new section?

minfinger 07-14-2014 06:35 AM

Re: All Products on front page, similar to featured products
 
1. Yes.
2. By product name, as its the name of the puppy.

tony_sologubov 07-16-2014 12:12 PM

Re: All Products on front page, similar to featured products
 
Sorry, I did not quite get the answer to the first question. Would you prefer option 1 (remove current featured products section) or option 2 (populate it with all products)?

Anyway, I will prepare code samples during next week and will post them here.

minfinger 07-19-2014 10:10 AM

Re: All Products on front page, similar to featured products
 
Apologies,

I see what you're asking now. I do not need the Featured Products Section at all, I only want the front page to be populate with all products and sorted by product name.

I really appreciate your help.

tony_sologubov 07-21-2014 04:45 AM

Re: All Products on front page, similar to featured products
 
Ok, thank you. I will post code samples within couple of weeks.

minfinger 07-21-2014 06:09 AM

Re: All Products on front page, similar to featured products
 
As I'm sure you're busy with other projects, I'm willing to pay for this to happen much sooner.

tony_sologubov 07-23-2014 06:22 AM

Re: All Products on front page, similar to featured products
 
Oh, that is a good option as well :)

tony_sologubov 07-30-2014 06:21 AM

Re: All Products on front page, similar to featured products
 
Hi Michael!

So, here is the instruction how to do this mod:
1) Create an empty module according to http://kb.x-cart.com/display/XDD/How+to+create+a+module

Do not forget to adjust your namespace.

2) In your module add the View/Custom/ProductsOnHome.php file with the following content:

PHP Code:

<?php

namespace XLite\Module\XC\CustomSkin\View\Customer;

/**
 *
 * @ListChild (list="center.bottom", zone="customer", weight="300")
 */

class ProductsOnHome extends \XLite\View\ItemsList\Product\Customer\Category\ACategory
{
    protected 
$allProducts null;

    protected function 
getHead()
    {
        
'My products';
    }

// this method defines that you do not need pagination
    
protected function getPagerClass()
    {
        return 
'\XLite\View\Pager\Infinity';
    }

// this method defines that all products must be displayed in this section
    
protected function getData(\XLite\Core\CommonCell $cnd$countOnly false)
    {
        if (!isset(
$this->allProducts)) {
            
$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAll();
        }

        return 
true == $countOnly
            
count($this->allProducts)
            : 
$this->allProducts;
    }

// disabling ability to sort products and switch between display modes
    
protected function defineWidgetParams()
    {
        
parent::defineWidgetParams();

        
$this->widgetParams[self::PARAM_GRID_COLUMNS]->setValue(3);

        unset(
$this->widgetParams[self::PARAM_SHOW_DISPLAY_MODE_SELECTOR]);
        unset(
$this->widgetParams[self::PARAM_SHOW_SORT_BY_SELECTOR]);
    }
}


Again, do not forget to adjust your namespaces.

3) Rebuild the cache and you will see the needed results.

minfinger 07-30-2014 10:23 AM

Re: All Products on front page, similar to featured products
 
This one won't enable either.

tony_sologubov 08-01-2014 01:59 AM

Re: All Products on front page, similar to featured products
 
Please make sure that you have Main.php file in your module, not main.php that starts with small letter.

minfinger 08-01-2014 08:18 AM

Re: All Products on front page, similar to featured products
 
I changed this one, but I'm having trouble getting the Rebuilding cache to cooperate.

minfinger 08-02-2014 04:25 AM

Re: All Products on front page, similar to featured products
 
I can not get this one to working, even though it shows enabled. Nothing has changed on the front page. The Product Advisor mod is still on. I tried turning it of, no difference.

minfinger 08-04-2014 08:26 PM

Re: All Products on front page, similar to featured products
 
1 Attachment(s)
Where is this folder structure supposed to be? View/Custom/ProductsOnHome.php

I thought it was supposed to be here: classes/XLite/Module/FasterThanYours/AllProductsFrontPage/View/Custom

Because I put the Main.php in classes/XLite/Module/FasterThanYours/AllProductsFrontPage/

Not sure what to do at this point. I've attached the ProductsOnHome.php I made

tony_sologubov 08-05-2014 04:33 AM

Re: All Products on front page, similar to featured products
 
Yes, you are right. This folder is supposed to be at
classes/XLite/Module/FasterThanYours/AllProductsFrontPage/View/Custom

Could you please pack your module and send it to me?

You should set up developer_mode option as On in the etc/config.php file and then you will see 'Pack it' link near each module in the 'Installed modules' section in admin area.

Once I receive the module, I will be able to check what is wrong with it.

Tony.

Quote:

Originally Posted by minfinger
Where is this folder structure supposed to be? View/Custom/ProductsOnHome.php

I thought it was supposed to be here: classes/XLite/Module/FasterThanYours/AllProductsFrontPage/View/Custom

Because I put the Main.php in classes/XLite/Module/FasterThanYours/AllProductsFrontPage/

Not sure what to do at this point. I've attached the ProductsOnHome.php I made


minfinger 08-05-2014 05:40 AM

Re: All Products on front page, similar to featured products
 
Here it is packaged up. Ok it wouldn't let me attach the tar file, so here's a link on Dropbox

https://www.dropbox.com/s/uq29hyxdl923wkc/FasterThanYours-AllProductsFrontPage-v5_1_3.tar

tony_sologubov 08-05-2014 06:25 AM

Re: All Products on front page, similar to featured products
 
Hi Michael!

You need to apply two fixes in order to make this module work:
1) Change the class name in the classes/XLite/Module/FasterThanYours/AllProductsFrontPage/View/Custom/ProductsOnHomePage.php file to ProductsOnHomePage (or change the file name to ProductsOnHome.php). The idea is that filename and classname must be the same.

2) Remove the very first space symbol before <?php construction in that file.

Rebuild the cache and after that, your module should start working properly.

minfinger 08-05-2014 06:34 AM

Re: All Products on front page, similar to featured products
 
Thanks, I just caught that extra space when I posted the link. I've changed the name and I'm working on rebuilding the cache now.

minfinger 08-05-2014 10:49 AM

Re: All Products on front page, similar to featured products
 
Tony,

The site won't Re-build the cache again. I cleared everything out of the var folder, but it's still just making the var\log\php_errors.log.2014-08-05.php file get bigger and bigger.

This repeats over and over.
PHP Code:

<?php die(1); ?>
[05-Aug-2014 13:42:33] Error (code: -9999): We are deploying new changes to our store. One minute and they will go live!
Server API: cgi-fcgi;
Request method: GET;
URI: /admin.php;
Backtrace: 
#0 /home/myyamaha/public_html/lpo/Includes/ErrorHandler.php(334): Includes\ErrorHandler::throwException('We are deployin...', -9999)
#1 /home/myyamaha/public_html/lpo/Includes/Decorator/Utils/CacheManager.php(480): Includes\ErrorHandler::fireError('We are deployin...', -9999)
#2 /home/myyamaha/public_html/lpo/Includes/Decorator/Utils/CacheManager.php(620): Includes\Decorator\Utils\CacheManager::checkIfRebuildStarted()
#3 /home/myyamaha/public_html/lpo/Includes/Decorator/Utils/CacheManager.php(650): Includes\Decorator\Utils\CacheManager::runStep(1)
#4 /home/myyamaha/public_html/lpo/Includes/Decorator/Utils/CacheManager.php(913): Includes\Decorator\Utils\CacheManager::runStepConditionally(1)
#5 /home/myyamaha/public_html/lpo/top.inc.PHP53.php(111): Includes\Decorator\Utils\CacheManager::rebuildCache()
#6 /home/myyamaha/public_html/lpo/top.inc.php(45): require_once('/home/myyamaha/...')
#7 /home/myyamaha/public_html/lpo/admin.php(35): require_once('/home/myyamaha/...')
#8 {main}


minfinger 08-06-2014 08:46 AM

Re: All Products on front page, similar to featured products
 
Ok I finally got it to rebuild, had to delete the var directory itself.

It's still not working.

tony_sologubov 08-08-2014 04:52 AM

Re: All Products on front page, similar to featured products
 
Hi Michael!

The problem with 'Error (code: -9999): We are deploying new changes to our store. One minute and they will go live! Server API: cgi-fcgi;' message populated php_errors log is fixed in 5.1.4. Please upgrade it and your php_errors log will be much cleaner.

As for the problem with the mod. Could you please pack it up and send it to me again? I will check it for you.

Tony.

minfinger 08-08-2014 12:27 PM

Re: All Products on front page, similar to featured products
 
I can't update because this is a temporary site I'm setting up in preparation of migrating the existing xcart to 5.X. I don't have a license to use with this site because of that.

Go here for the package https://www.dropbox.com/s/msjclt2vhoc5qku/FasterThanYours-ProductsOnHomePage-v5_1_3.tar

tony_sologubov 08-11-2014 11:50 PM

Re: All Products on front page, similar to featured products
 
Hi!

Thank you for sending the module.

In order to fix the problem you should edit the classes/XLite/Module/FasterThanYours/ProductsOnHomePage/View/Custom/ProductsOnHomePage.php file and replace the following line
PHP Code:

class ProductsOnHome extends \XLite\View\ItemsList\Product\Customer\Category\ACategory 


with the next one:
PHP Code:

class ProductsOnHomePage extends \XLite\View\ItemsList\Product\Customer\Category\ACategory 


Then, you should regenerate the cache and the problem will be fixed.

minfinger 08-12-2014 08:42 AM

Re: All Products on front page, similar to featured products
 
1 Attachment(s)
Ok finally it's working! Thanks.

Now onto my next problems. I wanted the "New", "Coming Soon" tags on the dogs. The only way to get that is to turn on the Product Advisor Module.

Now that I've done that, I'm seeing several issues. It's now listing separately below all the products, "New Arrivals" and "Coming Soon"

Additionally, see in the attached picture, when I go to the All Products Category, it's listing all products in duplicate and then again below that "New Arrivals" and "Coming Soon". All of the categories are the same way, but I only have a few test products, so the All Products shows the problem better.

And as a side note, I'd like to also color each Products listing Pink or Blue depending upon membership to the Female or Males category.

tony_sologubov 08-13-2014 11:10 AM

Re: All Products on front page, similar to featured products
 
1) You can disable showing New Arrivals and Coming soon products in the Product Advisor settings. Tick on the following settings:
- Display "New arrivals" block on sidebar (otherwise in center area)
- Display "Coming soon" block on sidebar (otherwise in center area)

2) In order to hide All products from category pages, you should edit the ProductsOnHomePage viewer class and add the following method there:

PHP Code:

public static function getAllowedTargets() 
    { 
        
$return = array('main');

        return 
$return
    } 


It should do the trick.

minfinger 08-13-2014 05:04 PM

Re: All Products on front page, similar to featured products
 
Tony,

1. Fixed.

2. I don't understand where in the code I should do that?

minfinger 08-14-2014 02:35 PM

Re: All Products on front page, similar to featured products
 
2 Attachment(s)
Ok I think I figure out where to put the code, because that fixed the duplication problem. But I'm having trouble with the Home page showing a product "ghosted" that has no inventory and is disabled. See Home Page 2014_0814.jpg I've also attached my Product Advisor Settings.jpg file

Just in case you want the current Package https://www.dropbox.com/s/z41ummw6ip033qb/FasterThanYours-ProductsOnHomePage-v5_1_3.tar

Here's the current ProductsOnHomePage.php file:
PHP Code:

<?php

namespace XLite\Module\FasterThanYours\ProductsOnHomePage\View\Custom;

/**
 *
 * @ListChild (list="center.bottom", zone="customer", weight="300")
 */

class ProductsOnHomePage extends \XLite\View\ItemsList\Product\Customer\Category\ACategory
{
    protected 
$allProducts null;

    protected function 
getHead()
    {
        
'My products';
    }

public static function 
getAllowedTargets() 
    { 
        
$return = array('main');

        return 
$return
    }  

// this method defines that you do not need pagination
    
protected function getPagerClass()
    {
        return 
'\XLite\View\Pager\Infinity';
    }

// this method defines that all products must be displayed in this section
    
protected function getData(\XLite\Core\CommonCell $cnd$countOnly false)
    {
        if (!isset(
$this->allProducts)) {
            
$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAll();
        }

        return 
true == $countOnly
            
count($this->allProducts)
            : 
$this->allProducts;
    }

// disabling ability to sort products and switch between display modes
    
protected function defineWidgetParams()
    {
        
parent::defineWidgetParams();

        
$this->widgetParams[self::PARAM_GRID_COLUMNS]->setValue(3);

        unset(
$this->widgetParams[self::PARAM_SHOW_DISPLAY_MODE_SELECTOR]);
        unset(
$this->widgetParams[self::PARAM_SHOW_SORT_BY_SELECTOR]);
    }
}


tony_sologubov 08-15-2014 04:50 AM

Re: All Products on front page, similar to featured products
 
Hi Michael!

I just wrote an article that describes the task you need to achieve:
http://kb.x-cart.com/display/XDD/Searching+entities+in+repositories#Searchingentiti esinrepositories-Pull...mplexcondition

Please, let me know if it helps.

Tony.

minfinger 08-17-2014 08:37 AM

Re: All Products on front page, similar to featured products
 
Tony,

I'm sorry I don't get this. What you wrote on that page, to me, doesn't even vaguely come close to what I've already gotten. I don't understand what needs to go where.

I'm at the end of my rope because none of the old developers I worked with don't even want to to touch XC5 because of well, many reasons.

totaltec 08-18-2014 03:29 AM

Re: All Products on front page, similar to featured products
 
Quote:

Originally Posted by minfinger
I'm at the end of my rope because none of the old developers I worked with don't even want to to touch XC5 because of well, many reasons.

I'll touch it. Drop me a line!

tony_sologubov 08-18-2014 05:50 AM

Re: All Products on front page, similar to featured products
 
Sorry for too technical explanation.

Let me try to explain it in simpler way.
1) In your module you need to create Model/Repo/Product.php with the content as provided here:
http://kb.x-cart.com/display/XDD/Searching+entities+in+repositories#Searchingentiti esinrepositories-Pull...mplexcondition

Make sure that you specify right namespace though!

2) In the View/Custom/ProductsOnHomePage.php file you should replace the following line:

PHP Code:

$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAll(); 


with the next one:

PHP Code:

$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAllActive(); 


3) Rebuild the cache.

It should do the trick.

Tony.

Quote:

Originally Posted by minfinger
Tony,

I'm sorry I don't get this. What you wrote on that page, to me, doesn't even vaguely come close to what I've already gotten. I don't understand what needs to go where.

I'm at the end of my rope because none of the old developers I worked with don't even want to to touch XC5 because of well, many reasons.



All times are GMT -8. The time now is 09:31 PM.

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