Composition of goods in the product slider...

  • Posts: 126
  • Thank you received: 0
11 years 3 months ago #158836

Hi, please recommend... What is the best option to display composition of goods in the product slider. With help custom fields or with "readmore", or you have a better solution?

1) When I use the custom fields I dont now how to displayed cod of new filed in product slider?
2) When I use "readmore", I dont now how to displayed in slider only text with composition of goods?

Last edit: 11 years 3 months ago by neviqimka.

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 3 months ago #158866

Hi,

Could you provide an example/more information of what you want to do so that we can understand what you need ?

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

  • Posts: 126
  • Thank you received: 0
11 years 3 months ago #158967

The text of my products contains description and composition. By what method I can display the composition in vertical product slider:

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 3 months ago #159002

Ok. So you want to create a custom product field where you'll be able to enter your composition.
To add it in the slider, you can edit the file listing_slider_vertical of the view product via the menu Display>Views and add such code:

echo $this->row->CUSTOM_FIELD;
where CUSTOM_FIELD is the column name of your field, instead of the code displaying the description:
echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description);

The following user(s) said Thank You: neviqimka

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

  • Posts: 126
  • Thank you received: 0
11 years 3 months ago #159168

Thank you very much! :)

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

  • Posts: 126
  • Thank you received: 0
11 years 3 months ago #159285

Can I implement with a custom field the extended desscription? My composition looks like this - "|Green|Black|Mixed| TEA WITH |strawberry|cream|pineapple|papaya | IN |caddy|package|filter|" - It's composition has several parts of the text and links

Last edit: 11 years 3 months ago by neviqimka.

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 3 months ago #159320

Hi,

I'm sorry but I don't understand your question.
What is an extended description ?
What do you mean by your composition example ?
Where you want to change what in the interface ?
Could you maybe do some screenshots with arrows and text explaining what you want exactly so that we can understand the situation and provide a solution ?

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

  • Posts: 126
  • Thank you received: 0
11 years 3 months ago #159355

Sorry :) I need the above custom fields - first custom filed will displayed checkboxes (green, black, mixed...), second custom filed will displayed links (strawberry, cream, pineapple, papaya...), third custom filed will displayed checkboxes too (caddy, package, filter...). And all this custom fields create one description on site and displayed in one sentence. Is this possible in HikaShop?

Last edit: 11 years 3 months ago by neviqimka.

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 3 months ago #159396

Sure. You can just have such code:
echo $this->row->CUSTOM_FIELD1.' TEA WITH '.$this->row->CUSTOM_FIELD2.' IN '.$this->row->CUSTOM_FIELD3;

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

  • Posts: 126
  • Thank you received: 0
11 years 3 months ago #159570

"second custom filed will DISPLAYED LINKS (strawberry, cream, pineapple, papaya...)" - How to create this? Because in checkbox field I can create only checkbox with text value not code. It looks like this - name: strawberry, value:

<a href="strawberry.html">strawberry</a>
or
<img src="strawberry.jpg" />
or
<a href="strawberry.html"><img src="strawberry.jpg" /></a>

Last edit: 11 years 3 months ago by neviqimka.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #159578

Hi,

You can use translations, for example as value of your checkbox you have "strawberry", put this in upper case:
STRAWBERRY

And then in Configuration > Language, add in the override part:
STRAWBERRY="<a href='strawberry.html'><img src='strawberry.jpg' /></a>"

Simple quotes need to be used inside the translation double quotes else it will break your translations.

The following user(s) said Thank You: neviqimka

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

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #159722

It's really interesting solution, thank you :) But it works only on product page, It does not work on product slider when I use code - echo $this->row->CUSTOM_FIELD in template (listing_slider_vertical.php)

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #159935

Hi,

Are you sure that this is the correct used view ? The custom field should be present in "$this->row" object.

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

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #159942

Sorry but I don't understand what you mean... I use this code in listing_slider_vertical.php:

<!-- PRODUCT DESCRIPTION -->
<div style="text-align:<?php echo $this->align; ?>; overflow:hidden">
<?php echo $this->row->my_field; ?>
</div>
<!-- EO PRODUCT DESCRIPTION -->
But on slider display only text value without links, all works correct only on product page

Last edit: 11 years 2 months ago by neviqimka.

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 2 months ago #159944

If you used translations, you can directly echo the value of the custom field.
You need to do like that instead:
<?php echo JText::_($this->row->my_field); ?>

The following user(s) said Thank You: neviqimka

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

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #160047

Yes now it's works...

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

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #160556

Again I have a problem... I slider displayed only one element of field. For example, on product page displayed: strawberry, ananas, apple etc. but in product slider displayed only strawberry :dry:
I use code

echo JText::_($this->row->my_field);
where "my field" is my alias of field

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 2 months ago #160569

Please provide a screenshot of the options of the custom field and a screenshot of what you entered in the custom field on the product edition page.

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

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #160707

HikaShop custom fields:


Language Manager > Language Overrides:

Product edit page:

listing_slider_vertical.php:


Result: On product page displayed: strawberry, ananas, apple., but in description of product slider displayed only strawberry

Last edit: 11 years 2 months ago by neviqimka.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #160764

Hi,

If think that it will require code like:

echo JText::_(str_replace(',',' ',$this->row->bcompound));

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

Time to create page: 0.085 seconds
Powered by Kunena Forum