Skip Navigation

[Resolved] Display product price and other information on a single line

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

This thread is resolved. Here is a description of the problem and solution.

Problem: When I use the [wpv-woo-product-price] shortcode to display my product price, it always appears on a single line. I would like to include information on the same line.

Solution: Use CSS to set the .price paragraph to be display:inline; by adding a class to a wrapper element for specific style targeting. For example:

<!-- html -->
<div class="inline-price-wrapper">[wpv-woo-product-price]</div>
/* CSS */
.inline-price-wrapper .price {
  display: inline;
}

Relevant Documentation: https://toolset.com/documentation/user-guides/views-shortcodes/

This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 8 replies, has 2 voices.

Last updated by adamS-15 7 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#505999

I am trying to: render two field values in one line instead of two separate lines

I visited this URL:hidden link

I expected to see: $25.00 Czas realizacji od 2 do 5 dni (in one line)

Instead, I got:
$25.00 <br> Czas realizacji od 2 do 5 dni

The current code I'm using is:

<td><strong>[wpv-woo-product-price]</strong>[wpv-post-taxonomy type="czas-realizacji" format="description"]
</td>
#506020

I'd like to take a look at your admin area to see why this is not working. Can you provide me with login credentials here? I will enable a private reply, and it may be tomorrow morning before I can follow up with you as the day is ending here.

#506317
Screen Shot 2017-03-27 at 10.15.07 AM.png

Okay, I see how we can resolve this. We can add a bit of CSS and a class to your 'strong' tag wrapper. Please see the attached screenshot.

1. Add the following CSS to your CSS editor panel:

.inline-price .price {
  display:inline; 
}

2. Add a class of "inline-price" to your 'strong' tag:

<td><strong class="inline-price">[wpv-woo-product-price] ...

This should cause your p.price to become an inline element. Please save these changes, refresh the page and let me know if this has not resolved your issue completely.

Also - I see you have some unnecessary code. In the first line, you can delete the opening "<img src=" before the [wpv-post-featured-image] shortcode. It's not needed, and actually creates an invalid HTML structure that may negatively impact your SEO.

<img src=[wpv-post-featured-image]

Instead, use:

[wpv-post-featured-image]
#506560

Thank you!
Christian, I need to learn CSS 🙂
... what's the best place to start besides hidden link ?

#506839

Hi, glad to help 🙂

I think I take for granted that I've learned CSS basics, because I honestly don't have a great recommendation for a starter guide! But I think either of these online courses look promising:

hidden link
hidden link

Eric Meyer is a very respected CSS author, so if you're looking for a book I'd recommend checking him out. Another great thing about CSS is that there are tons of resources online for it. And pro-tip: you can jump into the Chrome Inspector and see how sites are built: hidden link

#507009

Thank you so much!

#510555

Hello Christian!

How do I get this done using Layouts in a visual editor cell? There is no CSS editor.

my code for the cell inside Layouts

<strong>Koszt nagrania 30 sekund - [wpv-woo-product-price]</strong>

Thank you!
Adam

#511216

Hi, there's a CSS and JS editor for Layouts on a separate page. Toolset > Layouts CSS and JS. You can add whatever class you want to the "strong" tag, and then write your CSS definitions in Layouts CSS and JS.

#511288

Right 🙂 I'm blind!

Thanks Christian!

The forum ‘Types Community Support’ is closed to new topics and replies.