Post by Mosstyn » Sun Jun 10, 2018 5:06 am

Hi, Hope I've posted this in the right place. I've had a look as best I can and not found a solution to my question.
Using OC 2.3.0.2, and I want to display the word 'From' before the prices on the products on the category page. (On product grid/list)

I have achieved this by adding the text in the 'category.tpl' file, BUT, of course this adds it to all products in all categories.
I need it to display only on products that have different price options. I feel it gives better transparency to the pricing.

Any help or gentle nudging in the right direction would be appreciated.

New member

Posts

Joined
Tue Aug 01, 2017 7:02 am

Post by thekrotek » Sun Jun 10, 2018 5:46 am

I'm afraid changing the language variable won't help, because "Price" is a common word. So how you explain your customers, that on category page you have "From" and on product page is "Price"? I really don't see, any decent idea behind it.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by straightlight » Sun Jun 10, 2018 9:26 am

of course this adds it to all products in all categories.
I need it to display only on products that have different price options. I feel it gives better transparency to the pricing.
What also needs to be considered, in this case, is the product options can also be optional versus others that can be a required field before adding the whole product to the cart which can also be misleading to your customers. Granted, there might be a specific way to indicate a 'from' statement in front of only those products that may contain optional product options to fill but, at the same time, would also be a downside to the category list of your store as it would bring more questions by your customers.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Mosstyn » Sun Jun 10, 2018 3:11 pm

Thanks for your replies guys. Sorry thekrotek, I think you misunderstand my question. I'm not looking to replace any text. I'm looking to prefix the product price in category view with the word 'From' - but only products that have options. There are three options, all of which are required, one of which changes the price. The price changing option will ALWAYS be required (based on the length of the product). The product price is for the base product, but the vast majority of customers will choose a more expensive option. As a punter, I don't to see one price, and then pick my options only to find it's actually more expensive. A 'from' will give an indication that these prices may vary. Such as on Amazon - "23 new and used options from:" Thanks.

New member

Posts

Joined
Tue Aug 01, 2017 7:02 am

Post by Mosstyn » Sun Jun 10, 2018 3:37 pm

Straightlight, I get what you're saying. I've just had a look on Etsy, where I also sell, and they don't have any indications of variations of price on the category pages, but have a '+' sign after the base price on the product page. This disappears after the options have been selected and the price changes. Maybe this would be better. (Good enough for Etsy, etc).

New member

Posts

Joined
Tue Aug 01, 2017 7:02 am

Post by thekrotek » Sun Jun 10, 2018 4:46 pm

You can only achieve this with custom modification. I doubt, there's an extension for this, since the task is quite specific.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by victorj » Sun Jun 10, 2018 5:18 pm

U use a mod that adds a extra field Just above price.
In language file i did replace "price" for "" so original text price is not shown.
In extra field i can add anything like price per meter or price Starting from or Just price.

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by straightlight » Sun Jun 10, 2018 7:47 pm

Mosstyn wrote:
Sun Jun 10, 2018 3:37 pm
Straightlight, I get what you're saying. I've just had a look on Etsy, where I also sell, and they don't have any indications of variations of price on the category pages, but have a '+' sign after the base price on the product page. This disappears after the options have been selected and the price changes. Maybe this would be better. (Good enough for Etsy, etc).
This analogy is based on the product detail page while your first post refers to the category.tpl as my last reply is also based on the category.tpl file. Noticing that there are no indications of price on the category pages but do have a '+' sign after the base price on the product page itself still won't cover the facts that the product category listing page will bring up more questions whether knowing which products would imply a range of prices versus the products that contains mandatory product options to fulfill before adding those products to the cart.

While being the case, I would rather suggest to use an extension module from the Marketplace that can filter the price range which already mentions From x - To y which will ease the search for your customers.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Mosstyn » Mon Jun 11, 2018 4:07 am

Thanks for that guys. I'm not quite sure what you mean Straightlight. All I know is when I go to buy a t-shirt on Amazon and the the price says £20, I get ticked off when I select my size and the price goes up to £25. If I had a 'Price from £20' instead, I would be instantly aware that the price could be more than £20 depending on my option selections. Maybe that's just me and nobody else is bothered. The extra field option sounds like the boy. Cheers.

New member

Posts

Joined
Tue Aug 01, 2017 7:02 am

Post by obzelite » Thu Jul 01, 2021 5:58 pm

not sure if you ever found a solution, but i edited the product / product.twig and product / category.twig in the theme editor.

in the product i added the From:

Code: Select all

{% if price %}
          <ul class="list-unstyled">
            {% if not special %}
            <li>
              <h2>From: {{ price }}</h2>
            </li>
            {% else %}

in the category i added the From:

Code: Select all

{% if product.price %}
                <p class="price"> {% if not product.special %}
                  From: {{ product.price }}
                  {% else %} <span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span> {% endif %}

Newbie

Posts

Joined
Thu Feb 28, 2019 1:44 pm

Post by alex57580 » Tue Feb 22, 2022 8:21 pm

Hi,
Does somebody know how to add "from" before the price when the product has options
I would like to do it in product.twig and category.twig (Opencart 3.0)
Thanks
Alex

Newbie

Posts

Joined
Mon Oct 04, 2021 4:28 pm

Post by straightlight » Thu Feb 24, 2022 3:41 am

By using the |replace TWIG function, this could probably work: https://twig.symfony.com/doc/3.x/filters/replace.html or by using sprintf PHP function from the category and product controllers.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Mosstyn » Fri Jun 16, 2023 6:43 am

If someone is still looking for a type of solution (OC3) for putting 'from' on the category pages, what I ended up doing in 'category.twig' was a clumsy if/else based on my category headings. I know this won't work if you have a mix of simple products and variations in one category, but, if, like me you have categories of simple products, and categories of variations, then this works fine. -

Code: Select all

{% if product.price %}
          <div class="price">
            <div>
              {% if product.special %}
                <span class="price-new">{{ product.special }}</span> <span class="price-old">{{ product.price }}</span>
              {% elseif heading_title == 'YOUR CATEGORY TITLE' or heading_title == 'ANOTHER CATEGORY TITLE' or heading_title == 'A THIRD CATEGORY TITLE' %}
                <span style="font-size:13px">From&nbsp&nbsp</span><span class="price-normal">{{ product.price }}</span>
            {% else %}
                <span class="price-normal">{{ product.price }}</span>
              {% endif %}
            </div>
            {% if product.tax %}
              <span class="price-tax">{{ text_tax }}{{ product.tax }}</span>
            {% endif %}
          </div>
        {% endif %}

New member

Posts

Joined
Tue Aug 01, 2017 7:02 am
Who is online

Users browsing this forum: No registered users and 38 guests