Personalize_option.ocmod

In this XML, all the modification has been added for personalizing functionality.

Below is the list of files and code description of modified by Artifi personalize module

admin/controller/catalog/product.php

Code for sending product option of personalizing option to the model file

admin/model/catalog/product.php

If personalize option added for product show the selected option, if not then inserting data to the “artifi_personalization_option” table.

admin/view/template/catalog/product_form.tpl

Added HTML code for showing personalize option in the dropdown of admin product section

admin/controller/sale/order.php

Get the personalized data using “cart_item_id” using the personalize model through this function “getadminPersonalizeData” and also artifi setting data.

catalog/model/checkout/order.php

Replace one query and added the same query with “cart_item_id” for inserting data in the order_product table after order created by a user.

admin/view/template/sale/order_info.tpl

Added HTML and js code for show personalize data in the order info. Link’s of preview design, download pdf, and download XML. JS for initializing iFrame for show preview.

catalog/controller/product/product.php

Get the personalize option data for the product on frontend

catalog/view/theme/*/template/product/product.tpl

Added html,css and js code for loading popup modal on click on personalize button and also show or hide personalize button.

catalog/controller/checkout/cart.php

Get the personalize setting and personalize data using the personalize model and set for cart.tpl

catalog/view/theme/*/template/checkout/cart.tpl

Added code for the show the preview link and edit link on the shopping cart. Also added HTML and js for loading preview modal and edit model for the personalized image.

catalog/controller/checkout/checkout.php

Get the personalized data and set the session id if a guest or if login user set the customer id for updating userID in artifi admin as well as in “artifi_personalize” table.

catalog/view/theme/*/template/checkout/checkout.tpl

Added ajax call for update userid in the artifi admin and if get success updating same customer id in Artifi_Personalize table.

catalog/controller/checkout/success.php

After the order is placed successfully opencart calls the success.php controller, and gets the order_id in session. We fetch the personalized data using “order_id” and set for success.tpl file for calling Ajax.

catalog/view/theme/*/template/common/success.tpl

Added ajax call for updating order status as “added to cart” from “Placed” in Artifi admin using “design_id”.

system/library/cart/cart.php

The default behavior of cart.php from the library is, its adding new cart data after customer login. So we have changed this scenario like we are updating the only customer_id after customer login. And replace the same query.


Field Name

Description

personalize_id
Related wishlist item id
design_id
Design parameters
thumbnail_paths


ThumbnailURLss


product_id
PreviewURLss
customer_id


Customer Id (if user login)


session_id


Session Id for (Guest User)



order_id


Order id for personalizing a design


product_code



The product code for Artifi iframe


timestamp


Updated date and time


product_id
Product ID
language_id


Default language ID



personalize_optional



Personalize option for product


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.