- Posts: 25
- Thank you received: 0
List of Params?
15 years 5 months ago - 15 years 5 months ago #12344
by hoken30
List of Params? was created by hoken30
Hi, sorry couple questions here: I am trying to modify the mini-cart to show the total number of items but I'm not sure where to find this parameter? Is there a list of parameters I can find somewhere?
- I also would like to add the ability to change the amount of an item to add to the shopping cart (much similar to the one shown on individual product page) to the product listings page. I found this line in 'show' of product but I'm not sure how to adapt it over to listing_list. Please advise
$this->row =& $this->element;
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\''.$this->row->product_id.'\',field,1'.$form.'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
- And one more..on the product page when you click on the image it brings up the overlay with the larger image, is it possible to move this over to the product listing page as well? I can't seem to find where the code to control that is.
Appreciate any help.
- I also would like to add the ability to change the amount of an item to add to the shopping cart (much similar to the one shown on individual product page) to the product listings page. I found this line in 'show' of product but I'm not sure how to adapt it over to listing_list. Please advise
$this->row =& $this->element;
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\''.$this->row->product_id.'\',field,1'.$form.'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
- And one more..on the product page when you click on the image it brings up the overlay with the larger image, is it possible to move this over to the product listing page as well? I can't seem to find where the code to control that is.
Appreciate any help.
Last edit: 15 years 5 months ago by hoken30.
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12363
by nicolas
Replied by nicolas on topic Re: List of Params?
Normally, if you go in your hikashop cart module's hikashop options, you should have the option "show quantity" which, if activated will display the number of items automatically.
If you want to change the quantity of items in the shopping cart via the cart module, you should turn off the mini cart option and use the normal cart layout which allows you to change the quantity for each product in it.
For your last point, you can try to edit the file listing_img_title of the view product via the menu Display->Views and change the code:
<a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>">
<?php }
echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->product_name));
if($this->params->get('link_to_product_page',1)){ ?>
</a>
to:
<?php echo $this->image->display(@$this->row->file_path,true,@$this->row->file_name,'id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"'); ?>
If you want to change the quantity of items in the shopping cart via the cart module, you should turn off the mini cart option and use the normal cart layout which allows you to change the quantity for each product in it.
For your last point, you can try to edit the file listing_img_title of the view product via the menu Display->Views and change the code:
<a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>">
<?php }
echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->product_name));
if($this->params->get('link_to_product_page',1)){ ?>
</a>
to:
<?php echo $this->image->display(@$this->row->file_path,true,@$this->row->file_name,'id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"'); ?>
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12423
by hoken30
Replied by hoken30 on topic Re: List of Params?
As always, thanks a lot Nicolas! 3rd point is working.
For my second question what I meant was a way to modify quantities next to the 'add to cart' button, pretty much what you see on the product page, but I want to add it to the product listing page. I wanted users to be able to change the quantity while viewing the products and not in the cart itself. How can I do this?
For my second question what I meant was a way to modify quantities next to the 'add to cart' button, pretty much what you see on the product page, but I want to add it to the product listing page. I wanted users to be able to change the quantity while viewing the products and not in the cart itself. How can I do this?
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12448
by nicolas
Replied by nicolas on topic Re: List of Params?
You can edit the file listing_img_title of the view product via the menu Display->Views and add the code:
$this->params->set('show_quantity_field', 2);
at the beginning after the first <?php tag.
$this->params->set('show_quantity_field', 2);
at the beginning after the first <?php tag.
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12458
by hoken30
Replied by hoken30 on topic Re: List of Params?
didn't seem to work for me, i placed the above code into listing_img_title, but didn't change anything. What am i missing?
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12461
by nicolas
Replied by nicolas on topic Re: List of Params?
Please try this line instead then: $this->params->set('show_quantity_field', 1);
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12465
by hoken30
Replied by hoken30 on topic Re: List of Params?
that worked! One small problem, after I select the amount and click 'add to cart' button, the quantities box stops updating when i press +/-. I can tell that the amount is still changing since if I click 'add to cart' again the correct amount is added, but the display for the current quantities is wrong. Please advise
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12468
by nicolas
Replied by nicolas on topic Re: List of Params?
Could you give a link to your page ?
Please Log in or Create an account to join the conversation.
15 years 5 months ago - 15 years 5 months ago #12472
by hoken30
Replied by hoken30 on topic Re: List of Params?
I noticed in listing_img_title the ajax code is blank, I'm assuming this is the issue? But I'm not sure what to place in there:
$this->ajax='';
$this->setLayout('quantity');
echo $this->loadTemplate();
$this->ajax='';
$this->setLayout('quantity');
echo $this->loadTemplate();
Last edit: 15 years 5 months ago by hoken30.
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12476
by nicolas
Replied by nicolas on topic Re: List of Params?
It's only the first quantity box's + and - which do not work after adding a product to the cart on a page.
I couldn't see any js error and it happened in several browsers. I don't know from where that come but I doubt that it's from this code. It must be something else.
I couldn't see any js error and it happened in several browsers. I don't know from where that come but I doubt that it's from this code. It must be something else.
Please Log in or Create an account to join the conversation.
15 years 5 months ago #12479
by hoken30
Replied by hoken30 on topic Re: List of Params?
Alright I'll see if it's something else causing it, thanks once again Nicolas for your help and very prompt response!
Please Log in or Create an account to join the conversation.
Time to create page: 0.250 seconds