Comments (7)
Hi, this package doesn't provide any HTTP controllers, you need to create your own action class with your custom logic.
from yii2-cart.
Thx to reply igor,
I create my own controller, with post method.
$id = $model->id
$price = $model->price
$product = Product::findOne($id)
$cart->add($product);
so how, i can post the price like $cart->price($price).
Can you give me a idea..
thx..
from yii2-cart.
I think you don't need to post the price into cart (you need only add product model into it), because cart object retrieves this information from your model. For example in this widget:
<?php echo \yii2mod\cart\widgets\CartGrid::widget([
// Some widget property maybe need to change.
'cartColumns' => [
'id',
'label',
'price'
]
]); ?>
from yii2-cart.
Hi,
But unfortunately... The price is depends by User choice.
Example user can choice small pack or big pack. Small or Big pack have diferent price.
That why i need to post the price.
There is solution,
- Post the price, or
- post the packaging
from yii2-cart.
Ok, Also you can try this package https://github.com/omnilight/yii2-shopping-cart
from yii2-cart.
Maybe it's more flexible solution for your case
from yii2-cart.
Hi.. thx Igor..
Im already using that ext, but still confuse using it when post the price.
from yii2-cart.
Related Issues (20)
- public function getVat() { HOT 3
- Table wrong reference HOT 1
- Docs getUniqueId HOT 5
- QTY ? HOT 4
- Totals HOT 1
- Bug in Design HOT 1
- how to add and retrive information from cart? HOT 38
- migration error HOT 1
- I got problem with DataStorage HOT 6
- Problem migration back
- SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value
- table column 'cartData' can't save serialize() data
- Unable to have a float/decimal value in Cart item price HOT 1
- Argument 1 passed to yii2mod\cart\Cart::add() must be an instance of yii2mod\cart\models\CartItemInterface HOT 6
- Declaration of backend\models\Product::getPrice()... HOT 1
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax HOT 1
- May be you should active session before add to cart
- Serialization of 'Closure' is not allowed HOT 3
- add the quantity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-cart.