Hello sir. i wish to add item to custom object product with contect link.
but i’m getting only the data of the contact without the product data.
NB: the is no log error
my code:
CURLOPT_POSTFIELDS => array(
‘firstname’ => ‘Test’,
‘lastname’ => ‘DBS’,
‘email’ => ‘sys@gmail.com’,
‘customObjects’ => array(
‘data’ => array(
array(
‘id’ => 12, // Custom Object ID or alias for Products
‘alias’ => ‘products’,
‘data’ => array(
array(
‘name’ => ‘Order’,
‘attributes’ => array(
‘productprice’ => ‘8545’,
‘productID’ => ‘PD132’
)
)
)
)
)
)
/
)
));
Hi,
I’m having issues with installing it with PHP 8.1 and Mautic 5.0.3.
I tried both:
Release_ACS-2023.12.01-9
RELEASE_ACS-2022.09.02
Still same error after php8.1 bin/console mautic:plugins:install
no update
If I run the php8.1 bin/console cache:clear
then mautic is out I need to delete the folder plugins/CustomObjectsBundle/ and then again cache clear and it is back again.
Any help?
Thanks in advance.
Hi @janoslaszlo , I’m also having the same issue, just on the 5.0.3 version. Did you find a solution?
Hey, the Custom Objects plugin is not yet ready for Mautic 5.
The composer.json file is where you can find the plugin requirements for all Mautic plugins:
The work needed to make the plugin compatible with Mautic 5 is in this pull request:
acquia:5.x
← volha-pivavarchyk:update-to-5x
opened 11:48PM - 18 Feb 24 UTC
<!-- ## Which branch should I use for my PR?
Assuming that:
a = current ma… jor release
b = current minor release
c = future major release
* a.x for any features and enhancements (e.g. 4.x)
* a.b for any bug fixes (e.g. 4.0, 4.1, 4.2)
* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) -->
| Q | A
| -------------------------------------- | ---
| Bug fix? (use the a.b branch) | [ ]
| New feature/enhancement? (use the a.x branch) | [ ]
| Deprecations? | [ ]
| BC breaks? (use the c.x branch) | [ ]
| Automated tests included? | [ ]
| Related user documentation PR URL | mautic/mautic-documentation#...
| Related developer documentation PR URL | mautic/developer-documentation#...
| Issue(s) addressed | Fixes #...
<!--
Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against the "4.x" branch.
-->
#### Description:
Replaces PRs #298, #308, #316
<!--
Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do. If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
-->
#### Steps to test this PR:
<!--
This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
-->
1. Open this PR for testing locally (see docs on testing PRs [here](https://contribute.mautic.org/contributing-to-mautic/tester))
2.
<!--
If you have any deprecations, list them here along with the new alternative.
If you have any backwards compatibility breaks, list them here.
-->
Please, get involved with testing if you’d like to speed up the process.
1 Like
I have an Issue Linking Custom Objects together via API please anyone have don it before ?
These errors are showing in the log: No error log
Steps I have tried to fix the problem: This is the JSON structure of my code. it work only by linking the Contact with the custom object.
{
“email”: “{{1.billing.email}}”,
“firstname”: “{{1.billing.first_name}}”,
“lasname”: “{{1.billing.last_name}}”,
“phone”: “{{1.billing.phone}}”,
“last_active”: “{{1.date_created}}”,
“tags”: “{{1.meta_data.value}}”,
“customObjects”: {
“data”: [
{
“id”: 1,
“alias”: “product”,
“data”: [
{
“name”: “{{1.line_items.name}}”,
“attributes”: {
“prix”: “{{1.line_items.price}}”,
“id”: “{{1.line_items.id}}”
}
}
]
},
{
“id”: 2,
“alias”: “sale”,
“data”: [
{
“name”: “{{1.line_items.name}}”,
“montant-total”: “{{1.line_items.total}}”,
“quantite”: “{{1.line_items.quantity}}”,
“date-de-vente”: “{{1.date_created}}”
}
]
}
],
“relationships”: {
“vente”: {
“parent”: “product”,
“alias”: “sale”,
“data”: [
{
“name”: “{{2.line_items.name}}”,
“montant-total”: “{{2.line_items.total}}”,
“quantite”: “{{2.line_items.quantity}}”,
“date-de-vente”: “{{2.date_created}}”
}
]
}
}
}
}
I don’t see in the docs that it is possible to link custom items together. Where did you see it is possible?
Just wanted to know if the is a rout in the Custome object to link object together
After a while I finally got the plugin working. Maybe helpfull for other people who ran into the same problems. We’re running Mautic 4.4.12, with php 8.0.
First I tried to install the plugin with the following command (as www-data): php /var/www/html/bin/console mautic:marketplace:install acquia/mc-cs-plugin-custom-objects
That didn’t work. I got an error:
Then I did what I normally do when installing a plugin:
I copied the link to the github file. I used the branch @joeyk mentioned before: RELEASE_ACS-2022.09.02
Go to the plugin directory → cd /var/www/html/plugins
Download the zip file with the wget command: wget https://github.com/acquia/mc-cs-plugin-custom-objects/archive/refs/heads/RELEASE_ACS-2022.09.02.zip
Unzip the file: unzip RELEASE_ACS-2022.09.02.zip
Change the name: mv mc-cs-plugin-custom-objects-RELEASE_ACS-2022.09.02 CustomObjectsBundle
Install plugins: php /var/www/html/bin/console mautic:plugins:install
Then I got the message there were no plugins updated of installed
Clear cache: php /var/www/html/bin/console cache:clear
Then I tried to install the plugin again with the same command as in step 7.
I got this error message
I added the -vvv paarameter to my command to install the plugin: php /var/www/html/bin/console mautic:plugins:install -vvv
I logged in to Mautic and on the right in the settings menu there was a Custom Objects menu item.
Hope this helps someone!
1 Like