Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How Product Link Stored In Database? Rate Topic   - - - - -

 
  • asim786mail
  • Member
  • Trial users
  • Join Date: 14-Jan 22
  • 24 posts

Posted 22 January 2022 - 09:58 PM #1

I beleave this question is only for experts to guide me how to insert url using database.

I have developed an addon which will import all products from shopify and also from other cms websites but I don't understand how the images links are stored in database.

please guide me how can i save image links.

I think cscart_products is main database which have any field to link with image and url stores in cscart_images but the question is their relation how these are linked with eachother.

detailed answer will be really appricated.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22887 posts

Posted 24 January 2022 - 05:08 AM #2

The cscart_products and cscart_images tables are linked through the cscart_images_links one. Object ID should be equal to product ID


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • asim786mail
  • Member
  • Trial users
  • Join Date: 14-Jan 22
  • 24 posts

Posted 24 January 2022 - 08:09 PM #3

The cscart_products and cscart_images tables are linked through the cscart_images_links one. Object ID should be equal to product ID

 

Hi EcomLabs

thank you for your answer but still my confusion is there.

I have linked some images successfully but some was not done because there are 3 folders in images>detailed folder

those 3 folders are numbered like below.

0

1

8

sometimes it works if i store in 0 folder but sometimes it works if i save in 1 folder.

what is exactly these folders are and how we know which folder is being used for a specific product location?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 24 January 2022 - 08:55 PM #4

If you review the code in fn_images.php for the function fn_attach_absolute_image_paths(), in the 'functions' directory it will answer your question(s).  The numeric values are the result of the image_id / MAX_FILES_IN_DIR site constant.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.