Code Monkey home page Code Monkey logo

Comments (7)

ihorchepurnyi avatar ihorchepurnyi commented on June 10, 2024

Hi, this package doesn't provide any HTTP controllers, you need to create your own action class with your custom logic.

from yii2-cart.

prabukarana avatar prabukarana commented on June 10, 2024

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.

ihorchepurnyi avatar ihorchepurnyi commented on June 10, 2024

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.

prabukarana avatar prabukarana commented on June 10, 2024

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,

  1. Post the price, or
  2. post the packaging

from yii2-cart.

ihorchepurnyi avatar ihorchepurnyi commented on June 10, 2024

Ok, Also you can try this package https://github.com/omnilight/yii2-shopping-cart

from yii2-cart.

ihorchepurnyi avatar ihorchepurnyi commented on June 10, 2024

Maybe it's more flexible solution for your case

from yii2-cart.

prabukarana avatar prabukarana commented on June 10, 2024

Hi.. thx Igor..
Im already using that ext, but still confuse using it when post the price.

from yii2-cart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.