Closed futdev closed 6 years ago
Yes it's possible. Do you want currency_volume
to be added only to the order_item or only to the product - or both?
order_item
would be fine as I'm no longer using the product table since my products are dynamic in price based on order information, doing only order_item
would be sufficient enough right?
It should work with your code, after you have created a migration that adds the currency_volume
field to the order_items
table. Please let me know if I was correct/wrong :)
Worked perfect! thanks!
Oh wait, appears that it doesn't insert into the column? maybe it's not a specified column within the model?
Potentially down to this? https://github.com/vanilophp/order/blob/master/src/Models/OrderItem.php#L21
Exactly. Will fix it shortly and get back to you.
@fulopattila122 Thanks very much! do you have Skype?
Run composer update vanilo/order
. It should update the order component to v0.2.1, which has the desired behavior. Sorry, I don't really use Skype.
Note: wait ~ 3-5 minutes for packagist to pick up the new release.
I've only got "vanilo/framework": "^0.2"
inside my composer.json? when running composer update vanilo/order
I get Nothing to install or update
, any ideas?
Fixed! ran composer update vanilo/framework --with-dependencies
Thanks for such quick response & action on this!
No problem! Feel free to open another issue whenever you get into trouble :) Usually I respond in the evenings/mornings (Europe/Berlin).
@fulopattila122 Just a quick one, did you know that both these models aren't in the packagist?
use Vanilo\Product\Model\Product;
use Vanilo\Order\Model\Order;
I'd much rather use the Models
instead of the Factory
as it looks much cleaner, any better instructions mate?
What do you mean they're not in packagist?
When trying to use both of them like so:
<?php
namespace App\Http\Controllers;
use Vanilo\Product\Model\Product;
use Vanilo\Order\Model\Order;
class myController {
public function test() {
$order = Order::create(['number' => 'PO123456']);
}
}
I get the following:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class 'Vanilo\Order\Model\Order' not found
^ ignore, was a type in the use Vanilo\Order\Model\Order;
should have been use Vanilo\Order\Models\Order;
P.S; just for reference I'd advise updating this within your README.md also mate
Sure, you can absolutely use the models directly. Factory is actually to simplify the creation for you.
hallo guys.is it possible to change currency from usd to ksh??need help
hallo guys.is it possible to change currency from usd to ksh??need help
@johnnykiyaka please open a new issue next time for a new topic. Answer: https://vanilo.io/docs/0.5/configuration#configuring-the-framework
Is it possible within the
OrderFactory
to assign custom variables/attributes to the order? for example at the moment I've got the following:Would it be possible to maybe add the ability for us to add dynamic elements to the
$item
such as something like so?