Display related products in right side product detail page

  • Posts: 20
  • Thank you received: 0
7 years 16 hours ago #267627

-- url of the page with the problem -- : offline
-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0.16
-- Browser(s) name and version -- : Firefox latest
-- Error-message(debug-mod must be tuned on) --

: Notice: Undefined property: stdClass::$product_width in ....../public_html/components/com_hikashop/views/product/tmpl/show_block_dimensions.php on line 34

Notice: Undefined property: stdClass::$product_length in ....../public_html/components/com_hikashop/views/product/tmpl/show_block_dimensions.php on line 41

Notice: Undefined property: stdClass::$product_height in ....../public_html/components/com_hikashop/views/product/tmpl/show_block_dimensions.php on line 48



Notice: Undefined property: stdClass::$product_id in ......./public_html/templates/yootheme/html/com_hikashop/product/show_default.php on line 147

Notice: Undefined property: stdClass::$product_quantity in ....../public_html/components/com_hikashop/views/product/tmpl/quantity.php on line 22

Notice: Undefined property: stdClass::$product_quantity in ......./public_html/components/com_hikashop/views/product/tmpl/quantity.php on line 22

Notice: Undefined property: stdClass::$product_id in ......./public_html/components/com_hikashop/views/product/tmpl/quantity.php on line 62

Notice: Undefined property: stdClass::$product_quantity in ......./public_html/components/com_hikashop/views/product/tmpl/quantity.php on line 88
No stock

Notice: Undefined property: stdClass::$product_description in ....../public_html/templates/yootheme/html/com_hikashop/product/show_default.php on line 190

Hi hikashop,

I managed to load the related product module into the right side of my product detail page. I did this by editing the default view page, and used the loadposition function.
<div>
  <?php
$mypostion="{loadposition color}";
echo JHTML::_('content.prepare',$mypostion );
?>      
      </div>
The only thing is that everything under the module is gone now.
Did I used the wrong approach? Or can you help me out with fixing this?

I've attached 2 screenshots.

Thanx and kind regards,
Sanne

Attachments:
Last edit: 7 years 16 hours ago by sanneschoo.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
7 years 4 hours ago #267634

Hi,

It could be that it's just being push down the page. And in that case, you just have to hide the error messages.
Otherwise, that would mean that the rendering of the module is overwritting some of the data in the view. Try this then:

$backup = $this->element;
$mypostion="{loadposition color}";
echo JHTML::_('content.prepare',$mypostion );
$this->element = $backup;

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

  • Posts: 20
  • Thank you received: 0
6 years 11 months ago #267708

Hi Nicolas,

Thank you so mutch for this fast solution. It worked!
Only one little flaw, the pagination is now at the top of the discription. Is this possible to fix (see screenshot)?

Thanx again.
Ragards,
Sanne

Attachments:
Last edit: 6 years 11 months ago by sanneschoo.

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

  • Posts: 20
  • Thank you received: 0
6 years 11 months ago #267712

I found out it is not supposed to be there at all. It seems to be there because of the loadposition.

Last edit: 6 years 11 months ago by sanneschoo.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 11 months ago #267710

Hi,

Well, what do you mean by "fix" it ?
The pagination there is for the module. Displaying it elsewhere than below the listing would be illogical.
You can always hide it with some CSS if you don't want it at all there.

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

  • Posts: 20
  • Thank you received: 0
6 years 11 months ago #267780

In the first place I tought it belongd at the bottem of the page and was in the wrong position because of the code. That is what I ment with "fix" it. Later I found out it is ther for the module instead of the page....

Thanx again for the reply, I will hide it with css!

Kind regards,
Sanne

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

  • Posts: 20
  • Thank you received: 0
6 years 11 months ago #267782

Hi Nicolas,

Still another question.;)
I found out, that when I select a size varient of the product, the module with the related products disappears. (no errors shown)
Is there a possibility to show the module on the selected variants aswell?

Regards,
Sanne

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 11 months ago #267786

Hello,

More details about your module configuration would be require in order to be sure of your settings and reproduce your problem in a local/test website.

Right now with your current description, it is possible than a patch in the HikaShop core would be require in order to load the product parent related products when a variant is displayed.

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: 20
  • Thank you received: 0
6 years 11 months ago #267881

Hi,

That would be great!
Here the url and access (hidden):

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


regards,
Sanne

Last edit: 6 years 11 months ago by sanneschoo.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 11 months ago #267882

Hello,

www.hikashop.com/support/contact-us.html
Please include the URL of that forum thread too :)

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: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 11 months ago #267902

Hello,

I though you were trying to provide a link to the front-end.. My bad !

Please read my previous message

More details about your module configuration would be require in order to be sure of your settings and reproduce your problem in a local/test website.


I'm sorry but just credentials to your backend won't help us at all !
We need screenshot and details of your configuration regarding that part of your website, the module, etc.
We do not know your website and we cannot spent time to look for what is the module your talking about, etc.

That's why I asked you screenshots and not credentials ; so we won't use your credentials because it will not the best way for use to provide an efficient support.

Thank you for your understanding


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: 20
  • Thank you received: 0
6 years 11 months ago #267943

I'm sorry, I totally misunderstood. I thought you wanted to have a live look and the frontend is offline, so thats why I send login access.

So here the details :-)

I edited the product view in show_default.php with the next code on line 68:

<div>
      <?php
$backup = $this->element;
$mypostion="{loadposition color}";
echo JHTML::_('content.prepare',$mypostion );
$this->element = $backup;
      ?>        
      </div>

To load the following module in product view:
The hikashop conent module, copied from the default "related product" module. See screenshot for configuration. (Name: Related product color / ID: 198)

The problem is that it loads in the default product view, but when I choose a size variant. The module, price,size variant and add to cart dissapears. (See screenshots)

Please let me know if you need more details or if I got it wong again. :oops:

Regards,
Sanne

Attachments:

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 11 months ago #268012

Hello,

I'm sorry but your screenshots does not allow us to understand or reproduce the situation.
I don't see a link with a potential "module" and the fact that the "add to cart" button disappears.
That issue indicates some errors in the HTML DOM or some javascript issues.

I'm afraid that without any access to the page, without being able to see and understand what you're talking about ; we won't be able to give you any useful help.

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: 20
  • Thank you received: 0
6 years 11 months ago #268024

Hi,
If I understand you correct, you want to see the site online.
I put the site temporary online and send you a link thru the contact page.

Thanx again.
Regards,
Sanne

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 11 months ago #268031

Hi,

The problem is that you put the module loading code inside of the div which displays the price:
monosnap.com/file/wtGBeataJLSQojQannxbJj6EBTHh5w
Because of that, when you change the characteristic and the price is refreshed based on the selected variant, the whole div is refreshed with only the price and you loose the module.
You need to move it outside of the price displaying div and it will work properly.

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

  • Posts: 20
  • Thank you received: 0
6 years 11 months ago #268046

Hi,
That made it a bit better! now only the price and add to cart dissapears.
I tried several diffrent places to load the module, but they all had a different outcome, on what element disappears. Maybe it still has to do with pushing the page?!

Regards,
Sanne

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 11 months ago #268135

Hi,

You must need to make sure that you put it outside of the divs with the id finishing by _main.
An easy alternative is to remove the code adding the variants data as hidden on the product page. You can do that in the file "show" of the view "product" via the menu Display>Views. Without that, the _main divs won't be refreshed.

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

  • Posts: 20
  • Thank you received: 0
6 years 11 months ago #268467

Hi,
Putting it outside the div's didn't work and deleting the code of the variants did work but made the size selection not work properly. But...I managed to get the "add to cart" button to display. With help from a friend who knows a lot more then I do...
The only thing we can't figure out is the price that disappears. He asked this question:

The hidden div for the variant generated in "show" does not fill in the price properly and stays empty for all variant.
When I echo the content of $this->params->get('show_price'); or $this->params->get('show_price',-1); this returns 0 as a result.

This only happens in "show" when I initially load "show_default" the price displays properly.
Why could be the reason the price is 0 and thus hidden variant divs stay empty?


Hope you can help us to solve the last puzzle!
Regards,
Sanne

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
6 years 11 months ago #268518

Hi,

That's because you're displaying a listing module in the middle of the page and it itself has its own $this->params variable which overrides the one of your product page and in the module, you've turned off the display of the price.
Two solutions here:
- You could turn on the price display option of your module and instead add some CSS to hide the price of the product in the module.
- around the custom code you have which loads the module you could that:
$paramsBackup = $this->params;
// custom code
$this->params = $paramsBackup;
in order to not loose the params variable after the module is being displayed.

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

  • Posts: 20
  • Thank you received: 0
6 years 11 months ago #268615

Thanks Nicolas!
Everything works now :)

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

Time to create page: 0.092 seconds
Powered by Kunena Forum