Azrayiel Posted September 30, 2020 Share Posted September 30, 2020 (edited) Hello, I've been trying to find my way around this and make my modules show more than 8 products before I need to press the "View More Products" button. The modules are set to 30 from the configuration but that only seems to affect the "View More Products" button, I can view up to 30 products but only 8 will be loaded when the page is loaded. (If I set in the module a number smaller than "8" and I clear the cache, less than 8 products will be displayed on my homepage. If I go over 8 products in my module config, only 8 will be displayed on my homepage once I clear the cache) I'm assuming the culprit would be the php of each module (featured, new and top selling) but could not figure it out for the life of me. A PHP snapshot below of what I think is the code that needs to be adjusted: public function renderForm() { $fields_form = array( 'form' => array( 'legend' => array( 'title' => $this->trans('Settings', array(), 'Admin.Global'), 'icon' => 'icon-cogs', ), 'description' => $this->trans('To add products to your homepage, simply add them to the corresponding product category (default: "Home").', array(), 'Modules.FeaturedProducts.Admin'), 'input' => array( array( 'type' => 'text', 'label' => $this->trans('Number of products to be displayed', array(), 'Modules.FeaturedProducts.Admin'), 'name' => 'TMHOME_FEATURED_NBR', 'class' => 'fixed-width-xs', 'desc' => $this->trans('Set the number of products that you would like to display on homepage (default: 8).', array(), 'Modules.FeaturedProducts.Admin'), ), array( 'type' => 'text', 'label' => $this->trans('Category from which to pick products to be displayed', array(), 'Modules.FeaturedProducts.Admin'), 'name' => 'TMHOME_FEATURED_CAT', 'class' => 'fixed-width-xs', 'desc' => $this->trans('Choose the category ID of the products that you would like to display on homepage (default: 2 for "Home").', array(), 'Modules.FeaturedProducts.Admin'), ), array( 'type' => 'switch', 'label' => $this->trans('Randomly display featured products', array(), 'Modules.FeaturedProducts.Admin'), 'name' => 'TMHOME_FEATURED_RANDOMIZE', 'class' => 'fixed-width-xs', 'desc' => $this->trans('Enable if you wish the products to be displayed randomly (default: no).', array(), 'Modules.FeaturedProducts.Admin'), 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->trans('Yes', array(), 'Admin.Global'), ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->trans('No', array(), 'Admin.Global'), ), ), ), array( 'type' => 'switch', 'label' => $this->trans('Display Feature Product as Slider', array(), 'Modules.FeaturedProducts'), 'name' => 'TMHOME_FEATURED_SLIDER', 'class' => 'fixed-width-xs', 'desc' => $this->trans('Display Slider or Grid.(Note:Slider is working if "Number of product" is set more than 4).', array(), 'Modules.FeaturedProducts'), 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->trans('Yes', array(), 'Admin.Global'), ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->trans('No', array(), 'Admin.Global'), ), ), ), ), 'submit' => array( 'title' => $this->trans('Save', array(), 'Admin.Actions'), ), ), ); Kind regards, Ray tm_featuredproducts.php Edited September 30, 2020 by Azrayiel (see edit history) Link to comment Share on other sites More sharing options...
Azrayiel Posted October 1, 2020 Author Share Posted October 1, 2020 Playing with js-product-miniature in custom.js and increasing the variables from 8 to 10 on all devices helped me. Also I've increased X+4 (X I've assumed is the "Large Screens" variable and +4 means how many items are loaded when you press "View More". I've changed that to +5 as my row has 5 items on desktop size. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now