Trying to display an intro text that is different for each variant

  • Posts: 29
  • Thank you received: 1
7 years 10 months ago #272157

This should be quite easy I would have thought but I just cant seem to do this!

I could not get the default "read more" function to work , to divide the content into intro and main. IT just wont display even if I add the code
<?php if(!empty($this->element->extraData->topEnd)) { echo implode("\r\n", $this->element->extraData->topEnd); } ?>

So instead I added a custom field called "introduction". This is fine but when I displayed the field with

<?php echo $this->row->introduction; ?>

And this works but the field does not change with the variants.

So I checked the "normal" custom field display and the field does change with the variants (using show_block_custom_main.php).
The problem here is that it has a title "Specifications" and then the fields are listed in a table, with the field title and then the value.

I only have one custom field so I thought its ok, I can do an over-ride of show_block_custom_main.php and remove the title and the table markup.

This works, BUT for some reason when a variant is selected with options, the "sepcifications" title and the table come back. I cannot find where is coming from - I even modified the core file as well as my over-ride but I can't stop this.

This seems so hard to do such a simple thing. I hope there is an easy solution out there for me. I have checked hundreds of threads and read the documentation many times :(

Thanks.

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
7 years 10 months ago #272163

Hello,

When you create a thread ; please provide basic details about your website such as the HikaShop version number you're using.
It gives a great help because we can know the features you can use.

Otherwise, if you take a look at the "product / show", you'll see that there is some HTML code for the variants and also some JS to change dynamically blocks content with variant data.
The content you placed in your product page (show_default or show_....) is static.

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: roojai

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

  • Posts: 29
  • Thank you received: 1
7 years 10 months ago #272229

Hi Jerome,

Sorry about that.

And thanks for pointing out the show.php file - that explains it for me :)

Cheers

The following user(s) said Thank You: Jerome

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

Time to create page: 0.064 seconds
Powered by Kunena Forum