Skip to Content

New J2Commerce 6.6.5 is out. Here is everything in the release.

See What’s New
Account
Enter the email address on your account.
Forgot your username?
Enter your password.
Forgot your password?

Or continue with

Closed Public Category: Technical Support / Bugs Ticket #672

Wrapper for .j2store-product-images and .j2store-product containers

This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Conversation

Peter Reill

Where can I create an override so that I can create a wrapper in .view-article within .com-content-article__body for the two containers .j2store-product-images and
.j2store-product? I would like to display these in two columns.

Peter Reill

I found the location in the content plugin j2store in the file j2store.php on line 101. When I change this to $text = '<div class="j2store-product-container">' . $image_html . $html . '</div>' . $article->text; I have the wrapper. How can I use this as an override in a way that is safe for updates?

Olivier Buisard Staff

Hi Peter,

it is actually not possible to do so whitout the next update to override your additions.

Which leaves me with 2 options:

  • add a container div in the code
  • or add a template to the plugin that users can override.

I believe the lastsolution is the most flexible. 

I want to implement this for the next release. Let me check how this works out.

So, in your case, to avoid disruption, you will need to keep:

  • the override you made in the content plugin (which the update will override),
  • create a template override for the template file I will create (useless until the update, but ready for the update when it comes along). I will let you know what you need to do, once it is ready.

Sounds good?

Olivier.

Peter Reill

The flexible solution sounds great and is a fantastic addition. Thank you very much.

Olivier Buisard Staff

Hello Peter,

when J2Commerce 4.1 comes out, you will be able to have wrappers as suggested previously.

You can also create an override for the content plugin. You will just have to go to your template's overrides tab, go to the plugins -> content -> j2store to get the original field to override.

The output will come as:

<div class="j2store-product-wrapper j2store-product-[product_id] j2store-position-[position]">

	<div class="j2store-product-images-wrapper">
		// the product images
	</div>

	<div class="j2store-product-block-wrapper">
		// the product info
	</div>

</div>

Olivier.

Peter Reill

Hi Olivier,

great news. Thank you very much for the excellent implementation.

Olivier Buisard Staff

Thank you Peter! That's an improvement that will benefit others :-)

Olivier.