Post by Samick » Thu Feb 02, 2023 11:16 pm

Hello guys. I'm trying to make the OC image manager work twice on a single product edit page. I need to add a function so that the admin would be able to add images in 2 separate places on a product page instead of one.
After trying to set this up, the sort number and the attachment ID is inserted correctly, however, the image link is inserted into the main image gallery database table.
Maybe someone knows what I'm doing wrong? I try to call the image manager using the same functions as the other one. Do I need to duplicate the manager itself or what?

Newbie

Posts

Joined
Wed Oct 13, 2021 9:17 pm

Post by ADD Creative » Fri Feb 03, 2023 5:33 pm

It would help if you mentioned which version of OpenCart you are using.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Fri Feb 03, 2023 8:03 pm

Samick wrote:
Thu Feb 02, 2023 11:16 pm
I'm trying to make the OC image manager work twice on a single product edit page. I need to add a function so that the admin would be able to add images in 2 separate places on a product page instead of one.
Sounds like you're not really a developer so you'd probably be better of finding an extension that makes images easier to add. You could check our blog about this too: https://www.antropy.co.uk/blog/using-wi ... -opencart/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JNeuhoff » Fri Feb 03, 2023 9:10 pm

I need to add a function so that the admin would be able to add images in 2 separate places on a product page instead of one.
Can you please in easier to understand terms what exactly it is you are trying to accomplish that can't be done with a standard OpenCart?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Samick » Fri Feb 03, 2023 11:34 pm

Thank you guys for your answers so far. I'm only starting OC development (used to work with WordPress only, which is way simpler than OC). The version I'm using now is OC2.

What I need is this - to have the possibility to add image (apart from the main gallery. The database table should be separate as well) through admin panel in a different section of the product and categorty page (wherever I call it on the product and the category pages) for each product individually.

What I already accomplished - adding the sort order and product ID to a different table than the main image gallery. After inserting it through the image manager, the system does create the additional row in the necessary table and fills in product_id and sort_order, however, the link to the image appears on the image gallery table.

I have no idea how the image manager works and in this case, I need to understand how to make the image manager add the image link to other database table than the main image gallery of the product.

I really hope I explained it better this time. Thank you in advance for any answers. They are highly appreciated!

Newbie

Posts

Joined
Wed Oct 13, 2021 9:17 pm

Post by IP_CAM » Fri Feb 03, 2023 11:47 pm

The version I'm using now is OC2
Well, OC v.2 consists of several Subreleases, you need to quote the exact Version here, if you really expect some help.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by JNeuhoff » Sat Feb 04, 2023 12:58 am

Your description makes no sense. OpenCart (whatever version you use, please be more specific) already allows for additional images for products. There 2 DB tables for storing product images:

oc_product.image (for the main product image)
oc_product_image.image (for additional images)

I have no idea what you mean by 'image gallery'.

Please be more specific about what you are trying to do.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Samick » Sat Feb 04, 2023 1:31 am

oc_product.image is the featured image (main image)
oc_product_image.image is for the image gallery.
I need another one like oc_product_image.image to be placed as a separate "image gallery" on the product page, and also GET the image in the category page.

Newbie

Posts

Joined
Wed Oct 13, 2021 9:17 pm

Post by Samick » Sat Feb 04, 2023 3:14 am

Figured it out already. Nevermind

Newbie

Posts

Joined
Wed Oct 13, 2021 9:17 pm

Post by by mona » Sat Feb 04, 2023 3:25 am

Great please edit your title to mark your post as [ SOLVED ]

NB. Please be aware of the forum rules to save yourself time in the future - viewtopic.php?t=200480

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: No registered users and 169 guests