Closed victorighalo closed 5 years ago
How do you get this error?
This module is not dependent on the taxon module, so it has no knowledge about taxons. See: https://vanilo.io/docs/0.5/modules-vs-framework
Are you using the entire Vanilo Framework or only selected modules? If the latter, which modules do you use?
To get the list of modules: php artisan concord:modules -a
Yes. I installed the entire framework but i am not using the admin panel.
I got this from the documentation:
Assigning Taxons To A Product:
$product = Product::find(1); $taxon1 = Taxon::find(1); $taxon2 = Taxon::find(2);
To assign a single taxon: $product->addTaxon($taxon1);
To assign multiple taxons: $product->addTaxons([$taxon1, $taxon2]);
What I want to do is relate a product to a taxon/s.
You need to use the (extended) model from the Framework not the one from the Product Module:
use Vanilo\Framework\Model\Product;
$product = Product::find(1);
use Vanilo\Framework\Model\Product;
Thanks. so now I'm get the error
Argument 1 passed to Vanilo\Framework\Models\Product::addTaxon() must implement interface Vanilo\Category\Contracts\Taxon
What are you passing to addTaxon()
?
What are you passing to
addTaxon()
?
I'm passing a Taxon ID.
You need to pass a Taxon object as in the example
You need to pass a Taxon object as in the example
Oops! I missed that. It works now. Thanks.
Hi guys, so i just started using this library and i tried to add a Taxon to a product but i got the error :
I have to pause my project until this is resolved because i want to build with this library.