how to make a product grid view

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #248616

Great the bracket worked but its always a list or single column.

the other links such as http://...store?columns=2 and
http://...h/store?columns=3 doesnt work

also nic

i hope its ok,can you please remove my website link on your reply posts just for security reasons.

thanks a lot

Last edit: 7 years 8 months ago by ronron.

Please Log in or Create an account to join the conversation.

  • Posts: 26032
  • Thank you received: 4006
  • MODERATOR
7 years 8 months ago #248609

Hi,

Not at the end of the file ; just at the end of the added line :

if(!@$_GET['columns'] || $_GET['columns']>3){ $_GET['columns'] = 1;

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: ronron

Please Log in or Create an account to join the conversation.

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #248724

thank you its working

unfortunately all modules are affected by this. So my horizontal carousel slides are all single column.

maybe we should add the override in a different view?




thanks again

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
7 years 8 months ago #248733

Hello,

In that case the solution will be to use that PHP condition to check if we are in a module or not :

//If we are on a product listing module
if($this->module){

}

The following user(s) said Thank You: ronron

Please Log in or Create an account to join the conversation.

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #248856

hi

how do i complete this?

//If we are on a product listing module
if($this->module){ null;}
else {
<?php
if(!@$_GET['columns'] || $_GET['columns']>3){ $_GET['columns'] = 1;
$this->params->set('columns', $_GET['columns']);
 ?>
<a href="http://mayari.com.ph/store">1 column</a>
<a href="http://mayari.com.ph/store?columns=2">2 columns</a>
<a href="http://mayari.com.ph/store?columns=3">3 columns</a>
}
its not working. thanks

Last edit: 7 years 8 months ago by Jerome. Reason: [code] is nice

Please Log in or Create an account to join the conversation.

  • Posts: 26032
  • Thank you received: 4006
  • MODERATOR
7 years 8 months ago #248872

Hi,

When you write some code in the forum ; please use the "code" tag.

I am afraid that "it is not working" is not clear enough to understand what is not working exactly.
Now regarding your code, I can see a missing closing bracket.
If you want to learn PHP ; I suggest you to look for websites specialized in that domain.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #248934

thanks jerome

let me explain. i got the code below to work but my carousel modules are all in a list or single column because of code below.

//code for grid view altering columns
<?php
if(!@$_GET['columns'] || $_GET['columns']>3){ $_GET['columns'] = 1;
$this->params->set('columns', $_GET['columns']);
 ?>
<a href="http://mayari.com.ph/store">1 column</a>
<a href="http://mayari.com.ph/store?columns=2">2 columns</a>
<a href="http://mayari.com.ph/store?columns=3">3 columns</a>
}

mohammed thejii gave me the code below but i dont know how to use it.

hi and thank you Mohamed Thelji

what should i do with this please?

Hello,

In that case the solution will be to use that PHP condition to check if we are in a module or not :

//If we are on a product listing module
if($this->module){

}

Last edit: 7 years 8 months ago by ronron.

Please Log in or Create an account to join the conversation.

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
7 years 8 months ago #248935

Hi,

As Jerome said, you're missing a bracket. The code should be:

//If we are on a product listing module
if($this->module){ null;}
else {
<?php
if(!@$_GET['columns'] || $_GET['columns']>3){ $_GET['columns'] = 1;
$this->params->set('columns', $_GET['columns']);
 ?>
<a href="http://mayari.com.ph/store">1 column</a>
<a href="http://mayari.com.ph/store?columns=2">2 columns</a>
<a href="http://mayari.com.ph/store?columns=3">3 columns</a>
<?php
}
}
And also as Jerome said, this is basic PHP coding. Please contact professional developers to help you with such customization if you can't do it yourself.

Please Log in or Create an account to join the conversation.

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #249258

thanks Nic

i got this to work.

my next issue are the filters.

i created a sort filter, price range filter, search filter and others. all of these filters are not working together. example i searched for rings on the text search. if i click on sort the results reset or re-set. So instead of narrowing the results down it restarts. Its like its back to the original setting of the individual filters.

i also tried disabling force redirect on the module. the filters still doesnt respond accordingly.
this is the link. Please try to search for anything in the text search and try using the filters. the text you typed will be erased or reset.


Part of the message is hidden for the guests. Please log in or register to see it.


thanks again

Last edit: 7 years 8 months ago by ronron.

Please Log in or Create an account to join the conversation.

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
7 years 8 months ago #249274

Hi,

The issue is that your text search filter is in a different module than the sort filter. And each filter module is independent from one another.
You could try to turn on the "redirect POST mode" setting of the HikaShop configuration. It might help. But the best would be to have only one filter module with all the filters.

The following user(s) said Thank You: ronron

Please Log in or Create an account to join the conversation.

  • Posts: 490
  • Thank you received: 2
7 years 8 months ago #249877

hi

1.i would like to know please how come on small screens particularly Tablet portrait (768x1024) and below the columns wont separate in two or three columns. i think its because of the bootstrap. Can you point me where to fix this?

2. i would like my layout to change from img and description for single columns to image and title view for 3 or more columns, 2ould it be correct to add this small code as a solution.

also where to add this?

if ($_SERVER['mysite.com/single-column'] !== 'mysite.com/single-column') {
 call image and title layout
}

thanks
thanks

Last edit: 7 years 8 months ago by ronron.

Please Log in or Create an account to join the conversation.

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
7 years 8 months ago #249888

Hi,

1. Bootstrap CSS handles the switch from several columns to 3, but there is no intermediate.
It would require adding custom CSS to handle that such as:

@media (max-width: 1100px and min-width: 768px)
.col-sm-4 {
    width: 50% !important;
}

2. You can use such code:
$this->params->set('div_item_layout_type','img_title');

Last edit: 7 years 8 months ago by nicolas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.095 seconds
Powered by Kunena Forum