Post by ianhaney50 » Wed Aug 05, 2020 6:34 am

On my home page, I have made a image with a from label and added the image in a html block and added a shop now button but it would be good to have the price retrieved from the database for the specific category so if the price changes, it changes in the label so I don't have to keep changing the price text in the image.

Is there a extension that does this or anyone have sample code please, I am using oc 2.3.0.2. I have attached a screenshot of the images I made

Attachments

specific-category-from-price-question.jpg

specific-category-from-price-question.jpg (119.89 KiB) Viewed 370 times


Newbie

Posts

Joined
Fri Apr 29, 2016 4:21 am

Post by Wid » Wed Aug 05, 2020 3:47 pm

The correct way is to make a module and display your information in the posistion you want.
Price label has to be displayed as html and a good practice is to use bootstrap badge class, something like:

Code: Select all

<style>
.notification {
  text-decoration: none;
  padding: 15px 26px;
  position: relative;
  display: inline-block;
  border-radius: 2px;
}

.notification .badge {
  position: absolute;
  top: 12px;
  right: 10px;
  padding: 2px 5px;
  border-radius: 50%;
  background: red;
  color: white;
}
</style>
<div class="notification">
 <span class="badge">$100.00</span>
 </div>
The sql query to get the min price of a category is this: (you have to make it more complicateted if you want to check special and discount prices too)

Code: Select all

 SELECT product_to_category.category_id,`product`.`product_id`, min(price) FROM `product`, product_to_category where `product`.`product_id` = product_to_category.product_id group by product_to_category.category_id
If you cannot do it by yourself you have to pay someone else, I am glad to help you.

take a visit to My Modules !


Wid
New member

Posts

Joined
Fri Feb 02, 2018 9:19 pm
Location - Athens/Greece

Post by ianhaney50 » Wed Aug 05, 2020 5:11 pm

Thank you but yeah I won't be able to do it myself I don't think as unsure how to make it into a module and how to get the min price of just a specific category

Newbie

Posts

Joined
Fri Apr 29, 2016 4:21 am

Post by paulfeakins » Wed Aug 05, 2020 5:56 pm

ianhaney50 wrote:
Wed Aug 05, 2020 5:11 pm
Thank you but yeah I won't be able to do it myself I don't think as unsure how to make it into a module and how to get the min price of just a specific category
You'll have to pay a developer then.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: No registered users and 17 guests