Skip Navigation

[Resolved] Product Archive page not linking to products

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 4.95 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 2 voices.

Last updated by ChristineL838 7 years ago.

Assisted by: Nigel.

Author
Posts
#585372
Screen Shot 2017-11-02 at 14.32.59.png

I am trying to: set up my Product Archive page where you can see all the products for sale and click on the photo to go to the single product page.

Link to a page where the issue can be seen: hidden link

I expected to see: click on any product photo and go to it's single page

Instead, I got: when you click, the photo is just enlarged :-/ I've attached the back end screenshot here.

*Also, what is the best way to add spacing around my headline and title text on this same page?

#585455

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Christine

It looks like you have created a custom product archive page using Views.

I can't see how you have added the image to your archive, you may be using the featured image shortcode (wpv-post-featured-image) or the product image shortcode (wpv-woo-product-image).

Assuming you are using the featured image shortcode, you need to wrap it in a link to the individual product page.

Something like this:

<a href="[wpv-post-url]">
[wpv-post-featured-image size="medium"]
</a>

As for adding spacing around your text, again, I can't quite see how you are adding it, but you need to add padding to the elements where you want to increase the spacing.

In the template where you insert this text you can add custom class names to individual elements or their wrappers and then target those by adding some custom CSS.

e.g., if you have

<h2 class="extra-spacing">Some title</h2>

then you can add a CSS rule to the CSS editor like

.extra-spacing {
  padding: 16px;
}

Try the above and let me know if you have any problems.

#585473
Screen Shot 2017-11-02 at 15.59.10.png
Screen Shot 2017-11-02 at 16.00.17.png

Thanks so much Nigel!! Those code snippets worked perfectly and now I see exactly where to enter my CSS for other styling around the templates. Super helpful!

Another issue though - I followed one of the video tutorials and for some reason I'm not getting the results. My photos on my Single product templates are staying small and the gallery images are staying on the right side. I'd like a big image with small gallery images below the main photo.

this is the CSS I'm using:
.woocommerce.content-full-width div.product div.images {
width:100%
}

and screenshots show the details from the site. I followed the tutorial to the "T" - any idea why it's not working?

#585824

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Christine

If you use the standard WooCommerce template to display single products you will note that the layout has the image and thumbnail gallery on the left half of the page, and extra fields such as price and add-to-cart button on the right half of the page.

The shortcodes which Toolset provides when you design custom templates for WooCommerce products and the product archive (shop page) are built on top of WooCommerce and recreate the same UI elements, but allow you to position them elsewhere.

It is a peculiarity of the product image UI (main image plus thumbnails below) which the wpv-woo-product-image shortcode recreates that it only takes up half of the available space, specifically the left half, with the expectation that the right half will be used for the other fields in a similar layout to the standard WC design.

So if you add the wpv-woo-product-image shortcode to a cell which itself occupies only half the width of the page, then the image UI itself will only occupy a quarter of the width, no matter what setting you specify for the image width.

If you want a display format that doesn't have images on the left, other content on the right, you will need to hack into the CSS to override the default layout, or not use the WooCommerce image UI at all and create your own.

It is not ideal but results from building on top of WooCommerce's own functionality.

#585852

Hi Nigel,

I'm confused as I followed the tutorial video for setting up my template, I made a custom one like in the tutorial. In the video he changed the css, as I did to mine and made the change I'm looking for. Am I using the wrong template or page template builder or something else that's giving me different results from the tut? I used the same css they used:

.woocommerce.content-full-width div.product div.images {
width:100%
}

Or as a hack, I just tried to use "featured image" instead of woocommerce image and that gave me a full size photo, but is there a way to show the small product gallery photos, as well?

Trying to think of all solutions...any help much appreciated!!

#585856

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Christine

Which video tutorial did you follow?

I'm not sure what has been recommended to you.

#585859

https://toolset.com/learn/create-an-ecommerce-wordpress-site/single-product/

At around 7:30 he adds the css to make the photos stretch, etc.

#585953

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2017-11-03 at 12.35.43.png

Hi Christine

I saw the custom CSS added in the video and I checked it on a local test site and it didn't work for me, I suspect it is particular to the theme that was being used for the demonstration.

It is simply a question of working out an alternative CSS selector to target that container element and setting its width to 100%.

The rules set by WC themselves are very specific, making it hard to override without turning to !important, which I only use as a last resort.

So, what I did was

- Edit the Layout for single products and added an id of wc-custom-images to the cell containing the wpv-woo-product-image shortcode, as shown in the screenshot.
- Added the following CSS rule at the page Layouts > Custom CSS and JS

#wc-custom-images#wc-custom-images .woocommerce-product-gallery {
  width: 100%;
}

Note I'm employing a minor CSS trick here. Because the existing WC CSS rule is so specific, we need an even more specific rule to overwrite it. Using #wc-custom-images for the container isn't specific enough, but we can repeat it (no space), which is equivalent to using it once but is much more specific, meaning we win the battle to set the width on the required wrapper for the image UI.

Try that and see if that fixes it.

#586706

Thanks Nigel! Yes, that clever work-around did the trick. Thanks!