Display All Product Variants, Brand Name In Cart, User Menu

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 6 months ago #352428

-- HikaShop version -- : 4.7.3
-- Joomla version -- : 4.3.2

Hi there,

1) If I have more than one variant for a product, when I go to the page only one is visible. The other variant only shows when I make a selection from the one that is showing. I would prefer if they are all visible. How do I do that please?

2) The Brand name does not always display in the cart. I copied the code below to, checkout > show_block_cart.php and placed it above <p class="hikashop_cart_product_name">. The Brand name only displays if the product does not have a variation, but if it has a variation the brand name does not show.

<div class="product-brand">
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($product->product_manufacturer_id);
echo $manufacturer->category_name; ?>
</div>

3) In the user account, is it possible to have the menu to remain on the left no matter what option you click on. When you click on any option the menu disappears, it would be nice if it was always in that location so it's easy to access.



Thanks!

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 6 months ago #352431

Hi,

1. Change the "Characteristics selection method" setting to "List" in the HikaShop configuration and you'll see all the variants as a list on the product page.

2. Yes, that's normal. For variants $product contains the data of the variant. You would need instead something like this:

<div class="product-brand">
<?php
$class = hikashop_get('class.category');
if(!empty($product->product_parent_id)) {
$productClass = hikashop_get('class.product');
$parent = $productClass->get($product->product_parent_id);
$manufacturer = $class->get($parent->product_manufacturer_id);
} else {
$manufacturer = $class->get($product->product_manufacturer_id);
}
echo $manufacturer->category_name; ?>
</div>

3. There is no option to easily do that.
You would have to edit each view file of the control panel to add the left menu to it.
It's not impossible but even if I were to do it for someone as a custom work, it would take me at least several hours of work.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #352474

Hi Nicolas,

1. Change the "Characteristics selection method" setting to "List" in the HikaShop configuration and you'll see all the variants as a list on the product page.
Please see attached what happens when I change the selection to List, it moves them in a totally different location. I'm using radio buttons, as per attached (characteristics-selection-method-radio-button.png), can I not continue to use radio buttons but have them display all characteristics.



3. There is no option to easily do that. You would have to edit each view file of the control panel to add the left menu to it. It's not impossible but even if I were to do it for someone as a custom work, it would take me at least several hours of work.
I see... but it would be nice to have it laid out with the menu always on the left as it much more user friendly that way.

Thanks!

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 5 months ago #352475

Hi,

1. Ok, I think I understand what you want to do. Change the setting I talked about back to radio and instead, turn off the "Characteristics dynamic display" setting.

3. Thank you for your feedback. Maybe what you could have is to enable the Joomla breadcrumbs module ? It would help users to navigate back to the control panel main page, and know where they are in it.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #352505

1. Ok, I think I understand what you want to do. Change the setting I talked about back to radio and instead, turn off the "Characteristics dynamic display" setting.
OK. That's better. Thanks!

3. Thank you for your feedback. Maybe what you could have is to enable the Joomla breadcrumbs module ? It would help users to navigate back to the control panel main page, and know where they are in it.
This will do for now but hopefully the suggestion I made will be implemented at some point.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #352560

Hi Again,

How do I remove the word "Brand" from in front of the Brand Name on the detals page?

I had removed it in the language as per below, but I put it back because it also removed it from the backend.

MANUFACTURER="Brand"



Thanks!

Attachments:

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #352563

This is the code I'm using to display the brand on the product details page.

<?php
if($this->config->get('manufacturer_display', 0) && !empty($this->element->product_manufacturer_id)){
$categoryClass = hikashop_get('class.category');
$manufacturer = $categoryClass->get($this->element->product_manufacturer_id);
if($manufacturer->category_published){
$menuClass = hikashop_get('class.menus');
$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
if(empty($Itemid)){
$Itemid = $menuClass->loadAMenuItemId('','');
}
$categoryClass->addAlias($manufacturer);
echo JText::_('MANUFACTURER').''.'<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a>';
echo "<span style='display:none;' itemprop='brand'>". $manufacturer->category_name ."</span>";
}
}
?>

Thanks!

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 5 months ago #352562

Hi,

Then change the translation override to:

MANUFACTURER="<span class='brand_label_class'>Brand</span>"
Then, you can add such CSS:
.hikashop_product_page .brand_label_class{ display:none; }

Otherwise, you could just remove the part:
JText::_('MANUFACTURER').''.
from your code.

Last edit: 1 year 5 months ago by nicolas.

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #352586

Thank you :)

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #352891

Hi Nicolas,

How do I add the URL that takes the user to the brand. These are the codes I have for each section:

The Cart Page:
<div class="product-brand product-brand-cart">
<?php
$class = hikashop_get('class.category');
if(!empty($product->product_parent_id)) {
$productClass = hikashop_get('class.product');
$parent = $productClass->get($product->product_parent_id);
$manufacturer = $class->get($parent->product_manufacturer_id);
} else {
$manufacturer = $class->get($product->product_manufacturer_id);
}
echo $manufacturer->category_name; ?>
</div>


The Listings Page
<!-- BRAND NAME -->
<div class="product-brand product-brand-listing">
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->row->product_manufacturer_id);
echo $manufacturer->category_name; ?>
</div>
<!-- END OF BRAND NAME -->

Thanks!

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 5 months ago #352906

Hi,

You can replace :

echo $manufacturer->category_name;
with:
$menuClass = hikashop_get('class.menus');
		$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
		if(empty($Itemid)){
			$Itemid = $menuClass->loadAMenuItemId('','');
		}
		$categoryClass->addAlias($manufacturer);
		echo '<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a>';

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #352995

Hi Nicolas,

Neither worked. Did I do something wrong?

The Cart

<div class="product-brand product-brand-cart">
<?php
$class = hikashop_get('class.category');
if(!empty($product->product_parent_id)) {
$productClass = hikashop_get('class.product');
$parent = $productClass->get($product->product_parent_id);
$manufacturer = $class->get($parent->product_manufacturer_id);
} else {
$manufacturer = $class->get($product->product_manufacturer_id);
}

$menuClass = hikashop_get('class.menus');
		$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
		if(empty($Itemid)){
			$Itemid = $menuClass->loadAMenuItemId('','');
		}
		$categoryClass->addAlias($manufacturer);
		echo '<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a>';

 ?>
</div>

The listings
<div class="product-brand product-brand-listing">
  <?php $class = hikashop_get('class.category');
  $manufacturer = $class->get($this->row->product_manufacturer_id);
  
$menuClass = hikashop_get('class.menus');
		$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
		if(empty($Itemid)){
			$Itemid = $menuClass->loadAMenuItemId('','');
		}
		$categoryClass->addAlias($manufacturer);
		echo '<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a>';

  ?>
</div>

Thanks!

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 5 months ago #352997

Hi,

These pieces of code look fine. Where are you adding them exactly ? In which view file ? Between which code ?

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #353058

Hi Nicolas,

I've attached a screenshot of the views and where the code was (I removed it as it was causing errors).

Checkout Show Block Cart



Listing Img Title


Thanks!

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 5 months ago #353061

Hi,

Both look fine. You say that they "don't work". What do you mean by that ? You get an error message ? What error message do you get ?

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

  • Posts: 966
  • Thank you received: 11
  • Hikashop Business
1 year 5 months ago #353122

Hi Nicolas,

I get the below error for both.



Thanks!

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 5 months ago #353127

Hi,

Please try again after activating the "debug" setting of the Joomla configuration in order to get the full error message.
I can't say anything with the short error message in your screenshot.

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

Time to create page: 0.120 seconds
Powered by Kunena Forum