D
D
denism3002019-03-27 13:42:39
Joomla
denism300, 2019-03-27 13:42:39

How to add a name to a free attribute in JoomShopping?

I am writing a plugin for a quick order, among other functionality, it is possible to attach a file to the buyer. The file is uploaded to the server and a link to it is written in the free attribute of the product.
It happens like this:

JDispatcher::getInstance()->register('onBeforeAddProductToCart', function(&$cart, &$product_id, &$quantity, &$attr_id, &$freeattributes, &$updateqty, &$errors, &$displayErrorMessage, &$additional_fields, &$usetriggers) {
    .......
    $freeattributes['File'] = JHtml::link($path_to_file . '/' . strtolower($file['name']), $file['name']);
    .......
});

In the database, in the #_jshopping_order_item table, this is written like this:
the freeattributes field
a:1:{s:10:"File";s:134:" filename.jpg ";}

product_freeattributes field
: filename.jpg

How to add a name to the product_freeattributes field so that it looks like:
Uploaded file : filename.jpg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question