Displaying products in product listing page

  • Posts: 29
  • Thank you received: 0
13 years 2 months ago #29003

Hello,

I would like to know if i can display products in under each subcategory in category listing page. My scenario is like show the category listing page with subcategories (this is happening with the default template structure of hikashop) and then i need to display the products in the same category listing page under each sub category. This is for avoiding more clicks and give a user friendly workflow to the client. So let me if this is possible ?.

There is one alternative to this method by using the product listing page but i need to segregate products based on subcategory. Now i am able to show all the products under the main category in product listing page but it is displaying in a random manner. If i want to do this my modifying the queries and code means in which files i need to make changes.

Kindly help me on this matter.


Regards,
Binoy

Attachments:
Last edit: 13 years 2 months ago by binoy_p_v.
The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 2 months ago #29029

Hi,

You can't do a display like that. Not unless you heavily modify the code.

For the products listing, you should look at the hikashop options of it and make sure that the random option is turned off, otherwise the listing will be random. Then, you can order the products based on the ordering you define in the listing of products on the back end when you display the products of a category.

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 2 months ago #29123

Hi

Thanks for the reply.

I am ok with the coding part as i am in to PHP development field.So kindly let me know in which file we need to do the modifications. I have tried modifying the view files but in some areas i need to modify the query to show the products based on categrory and subcategory.

Also let me know if i can achieve this same goal with multiple content modules. If we can create content module for each subcategory and include all the required content modules in an article page. Please let me know if this option is feasible or not. Also let me know the method.


Regards,
Binoy

The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 2 months ago #29139

Hi,

Indeed you can modify the files (it depends on the layout you're using) of the category view to load the products data, but it's really not easy to do as you need to load all the product data from the database.

Your second solution sounds way easier to implement as it doesn't require any code modification. You can just create an article with the category names and under each name use the load position plugin of joomla to load one hikashop content module instance corresponding to the listing of products of that category. Here is some documentation about that joomla plugin: docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 2 months ago #29176

Hello,

Thanks for the reply. As you mentioned in your reply i did the customization to display the categories raw wise and tried calling the product div view by using loadmodule option but i am getting the categories repeated below each category. I believe it is because your listing logic is based on the folder ,like category, product , in which the view files are defined. I think i will be able to solve this issue if i can call a controller or the product listing code with the respective category id. So kindly let me in which file i need to make the modification for displaying products from database.


I have tried the second option also but the modules are not displaying in article pages after adding the modules. I think i have followed the right method for creating content module. I have created a product listing content module from view option in hikashop by selecting the desired subcategory as the parent category and by including all the direct sub elements but while adding the module in article pages nothing is displaying. Also i have some doubt about content module creation, as per your help file, we need to unpublish the module in order to avoid the module being displayed in other joomla pages. Also i need to display multiple product listing module in a single page.

as in demo.aappakadai.com/index.php?option=com...cle&id=117&Itemid=89
in this page starters, soups etc are sub categories under the category CHETTINAD & SOUTH INDIAN. The same thing i need to achieve via hikashop but i am struck at demo.aappakadai.com/index.php?option=com...le&id=120&Itemid=101



So please give me detailed info on content module creation.



Regards,
Binoy

Last edit: 13 years 2 months ago by binoy_p_v.
The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 2 months ago #29192

Hi,

Well, the modification to load a view and add it in your category listing is obviously to be made in your category view file.
The modification is quite simple to add:
<?php
$js = '';
$params = '';
JRequest::setVar('cid',$category_id);
echo hikashop_getLayout('product','listing',$js,$params);
?>

that should load a listing of products based on the categories in the category with the id $category_id.
The options which will be used for the display of the products will be the ones from the Display tab of the configuration.


For the display of modules in a joomla article, that's a standard thing in joomla. It's not just for HikaShop but for any module. If it doesn't work, it must be that you didn't do it properly. But it's hard to tell what without you telling us exactly what you did. What tag did you use in your joomla article ? Did you publish the plugin ? did you create a position in your template ?
Here is a more detailed help page about inserting a module in an article:
www.acyba.com/en/support/documentation/1...le-into-content.html

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 2 months ago #29248

Hello,

Thanks for the support and the first option worked for me. When i have used the code <?php
$js = '';
$params = '';
JRequest::setVar('cid',$category_id);
echo hikashop_getLayout('product','listing',$js,$params);
?>
the product listing was showing products under categories even if the products are not belongs to that category. Also categories without products also where showing products below them though i have passed the correct cid.
So i have changed the code as below.

<?php
$js = '';
$params = '';
JRequest::setVar('cid',$category_id);
echo hikashop_getLayout('category','listing',$js,$params);
?>
And now the products are displaying properly but without add to cart link as the products are displaying from category view.

Please check the URL below.
demo.aappakadai.com/index.php?option=com...t=listing&Itemid=101

So kindly let me if i can add add to cart button in product listing in category view and if yes how?.


Regards,
Binoy

The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 2 months ago #29262

You should go in your menu's hikashop options and change the type of content from category to product, then turn on the add to cart button display and then switch back the type of content option and save the options.
Also, make sure that the add to cart display option is turned on in the Display tab of the configuration of HikaShop.

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 2 months ago #29279

Hi,

I have tried the option you have explained in your reply but this method displays all the items in the page without segregating the products under each subcategory. Now the output in my page demo.aappakadai.com/index.php?option=com...t=listing&Itemid=101 is perfect but doesnt have add to cart button. So let me know if i can add the add to cart code in category view code using the respective product id. let me know in which view file i need to make changes to add the add to cart button(with Ajax)

Regards,
Binoy

The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 2 months ago #29302

Hi,

I'm afraid you didn't understand my message. But that's ok, let's do it differently.
Go in the menu Display->Views, edit the file "listing_img_title" of the "product" view and just change the line:
if($this->params->get('add_to_cart')){

by:
if(true){

and that will display the add to cart button on your page.

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 2 months ago #29326

Hello,

I am getting error when i changed if($this->params->get('add_to_cart')){

by:
if(true){

I am getting the below mentioned error

Fatal error: Call to a member function displayButton() on a non-object in /data/23/2/145/23/2308512/user/2536027/htdocs/aappakadai/demo/templates/jv_sello_II_v1.5.0/html/com_hikashop/product/quantity.php on line 51

I couldn't realize when it is coming.Please help in this issue also.

Regards,

Binoy

The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 2 months ago #29336

Ah yes, you will also need to add before that line the code:
$this->cart =& hikashop_get('helper.cart');
$this->catalogue = (int)$config->get('catalogue',0);
$this->cart->cartCount(1);
$this->cart->cartCount(1);
$this->cart->getJS($this->init());

so that the add to cart button can be displayed.

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 2 months ago #29483

Hello,

I have modified the code as you had mentioned in your previous but still i am getting the same error.

but the line number has been changed


Aappam 1.5
Fatal error: Call to a member function get() on a non-object in /data/23/2/145/23/2308512/user/2536027/htdocs/aappakadai/demo/templates/jv_sello_II_v1.5.0/html/com_hikashop/product/listing_img_title.php on line 55.


Please let me know why this is happening.

Regards,
Binoy

The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 2 months ago #29498

I forgot one line in the code I gave you.
It should be:

$this->cart =& hikashop_get('helper.cart');
$config =& hikashop_config();
$this->catalogue = (int)$config->get('catalogue',0);
$this->cart->cartCount(1);
$this->cart->cartCount(1);
$this->cart->getJS($this->init());

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 1 month ago #30628

Hi Nicolas,

Thanks for the great support. The product listing in category page is working perfectly now. Now i have a query and this is regarding the options of a single product. Assume that i have product called T-shirt and it has three sizes like Small , medium and Large. The price for the T-shirt will be changing as per the size of the T-shirt. For eg T-Shirt Small 5 Dollars, T-Shirt Medium 6 Dollars, and T-Shirt Large is 7 dollars. Users should be able to select the size and then add the product into the cart.

Kindly advice me if i can do this using hikashop. It would be great help if you could guide me to achieve this option.

Attached our product demo with each items having two quantities like half and full.


Regards,

Binoy

Attachments:
The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 1 month ago #30676

You can use characteristics for that:
www.hikashop.com/en/support/documentatio...html#characteristics
That will create variants for your products and you will be able to set a price for each variant and have a specific add to cart HTML button for each variant.

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 1 month ago #30935

Hi Nicolas,

Thanks for the support. I have one more concern now like, i have created product pages with related projects in the bottom of the product page but when listing the related products it is showing only 20 items in the first page .And if we click on next button or page number 2 it is showing error. So instead of that i want to display the whole list in a single page without pagination. The maximum number of related items i have is only 50 so i need to display the whole set of 50 items in a single page. I have tried removing the pagination code from lising.php file and also i gave the number of items in product display settings as 60. But still the same thing is happening.

Kindly help me to solve this issue. We are almost ready launch the site and your tool was satisfying most of our requirements except few. Thanks for such a good opensource product.

Screen shot Attached.

Regards,
BInoy

Attachments:
The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 1 month ago #30946

If you want to remove the pagination in that related module, you should just increase the "number of items" option to 50 in your related module's hikashop options that you can access via the menu Display->Content modules.

The topic has been locked.
  • Posts: 29
  • Thank you received: 0
13 years 1 month ago #31209

Greetings,

Thanks for the reply. My product listing issue has been solved once i increased the number of listings as per your reply.

Sorry for coming with new new issues everytime. Now i am facing problem like, characteristic is not displaying in cart even if i select a characteristic for a product. Please find attched the screen shot, inwhich i have selected less-oil as charecteristic for the product Chicken Soup (Half)but it is not displaying in the cart.

So kindly help me on this.

Regards,
Binoy

Attachments:
The topic has been locked.
  • Posts: 83103
  • Thank you received: 13414
  • MODERATOR
13 years 1 month ago #31246

You should turn on the option "Append characteristics value to product name" in the Display tab of the configuration for that.

The topic has been locked.
Time to create page: 0.073 seconds
Powered by Kunena Forum