Customize Product Page

  • Posts: 20
  • Thank you received: 0
9 years 4 months ago #230741

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

Hello Again,
On the Product page I would like to move the Product Name which is currently in hikashop_porduct_top_part to the hikashop_product_right_part. I tried with moving this part of the code in show_default view to the hikashop_product_right_part but nothing changes.
The code I moved is:

<h1>
		<span id="hikashop_product_name_main" class="hikashop_product_name_main">
			<?php
			if (hikashop_getCID('product_id')!=$this->element->product_id && isset ($this->element->main->product_name))
				echo $this->element->main->product_name;
			else
				echo $this->element->product_name;
			?>
		</span>
		<?php if ($this->config->get('show_code')) { ?>
		<span id="hikashop_product_code_main" class="hikashop_product_code_main">
			<?php
			echo $this->element->product_code;
			?>
		</span>
		<?php } ?>
  	</h1>

Could you please point me in the right direction?
Thank you!

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

  • Posts: 84079
  • Thank you received: 13629
  • MODERATOR
9 years 4 months ago #230750

Hi,

That's correct.
There are two possibilities:
- You're editing the view file for another template than the template you're using on your website frontend.
- You're not editing the correct view file. The show_default view file will only be used if the "layout on product page" setting is set to "default". If you set it to "reverse" or "tabular", then it will be another view file (show_reverse or show_tabular).

The following user(s) said Thank You: tesla

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

  • Posts: 20
  • Thank you received: 0
9 years 4 months ago #230765

Thanks a lot, Nicolas!
My "layout on product page" was set to "tabular". When revert it to "default" it worked.
Could you please point me to the right place (file/view) to obtain the same result while keeping the "tabular" layout?

I also would like to set a background-image for the hikashop_product_right_part area by adding the following at the end of the Configuration>Display>CSS>Front-end CSS File-EDIT

.hikashop_product_right_part {
background-image: url(../upload/background_image.jpg);
}
This way looks ok on big screen but the background-image as can be expected is not responsive :(
Could you please advise is it possible to make the image fit in the size of the ...right_part and also make it responsive?

Last edit: 9 years 4 months ago by tesla.

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

  • Posts: 193
  • Thank you received: 76
9 years 4 months ago #230800

For tabular view it's file components\com_hikashop\views\product\tmpl\show_tabular.php between lines 46-62.

.hikashop_product_right_part {
background-image: url(../upload/background_image.jpg);
background-size: cover;
}
You can use media queries to set different background image for every screen resolution you need.
.hikashop_product_right_part {
background-image: url(../upload/background_image.jpg);
background-size: cover;
}

@media (max-width: 768px) {
    background-image: url(../upload/background_image2.jpg);
}

The following user(s) said Thank You: tesla

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

  • Posts: 20
  • Thank you received: 0
9 years 4 months ago #230895

Thank you very much, KORZO!
This (background-image: cover;) solves the fit-to-size of the right-part area.

Now I have to figure out how to make the parts of the Product page (the top, left, right, bottom) responsive - the images and the text. Currently neither the Product image, nore the background-image on the right are responsive.
One way is probably with the @media as you suggest but I hope there is an easier one as well :)
I was hoping that there is some class such as responsive or similar that resizes the elements depending on the screen resolution without having to provide the images for the Product page parts in the different sizes.

EDIT: The tempalte I use is Purity III, which is a responsive template and all my other menues are responsive

Last edit: 9 years 4 months ago by tesla.

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

  • Posts: 12953
  • Thank you received: 1778
9 years 4 months ago #230898

Hello,
If you want your page to be responsive depending on the screen resolution, you'll automatically need to use the "@media" CSS property to adapt the display.

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

  • Posts: 20
  • Thank you received: 0
9 years 4 months ago #230952

Thanks, Mohamed!

Could you please give an example how to automatically apply the @media property without having to provide separate images for the separate screen sizes?

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
9 years 4 months ago #230966

Hello,

As example of @media code



Here, vou have an image that will be displayed with a 200 pixel siez (widht) for ALL media size, except under a 700 pixel width media.
And so, thanks to @media the image will be displayed with 100 pixel width.



Regards,

Attachments:
Last edit: 9 years 4 months ago by Philip.
The following user(s) said Thank You: tesla

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

  • Posts: 20
  • Thank you received: 0
9 years 4 months ago #231060

Thanks a lot, Philip!
It is awesom to have you, Mohamed and Korzo guiding me towards my goal, responsive Product Page, Cart, Checkout process pages, etc.
I will play with the example and concept provided and will hopefully be able to present the result soon.
Meanwhile, if anything else becomes an obstacle I hope you don't mind to keep you posted :)
Cheers,

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

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #233685

Hello Again ;)
@media will do the part of the job.
What I can't find a way to do is to arrange .hikashop_produc_right_part after .hikashop_product_left_part when viewing on smaller (mobile) screens. Would some css do the job?
Cheers,

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

  • Posts: 84079
  • Thank you received: 13629
  • MODERATOR
9 years 3 months ago #233699

Hi,

Yes. You can do it with CSS. Change the width of both divs to 100% with CSS for small resolutions using the @media query and it will do it.

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

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #233734

10x a lot, Nicolas!
Interestingly, I was trying your suggestion prior to asking here but it iddn't work. Now I tried again but this time using "!important " to the width of 100% and voila :)

One last thing on the Product page: where should I make a change in order to have the thumbnails one next to the other instead of one above the other (currently I have just 2 thumb images)?

Moving to the CheckOut layout the following question comes out:
How can I make the separate parts of the checkout process expandable having a "+" sign to expand each group (the group of Shipping, Payment, etc.) and the groups (steps) of the checkout process follow one after another?

Thanks again!

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

  • Posts: 84079
  • Thank you received: 13629
  • MODERATOR
9 years 3 months ago #233815

Hi,

The thumbnails are already one next another on the product page by default in HikaShop. So if that's not the case, there must be problem with the way the page was customized or with your template CSS.

For what you want to do in the checkout, you'll have to edit the file "step" of the view "checkout" via the menu Display>Views and add the HTML and javascript to handle that where the views are displayed.

Please open new threads for unrelated issues.

The following user(s) said Thank You: tesla

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

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #234266

Thank you, Nicolas!
The thumbnails became one next to another once I did a frontend css change (DIsplay->CSS) : img {display: inline !important;}

I will write a separate post about the checkout grouping questions.

BR and good day to everyone!

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

Time to create page: 0.107 seconds
Powered by Kunena Forum