pistol88 / yii2-cart Goto Github PK
View Code? Open in Web Editor NEWYII2 cart module
License: Other
YII2 cart module
License: Other
I though to solve my problems I could just download the package (outside in composer) and integrate and modify it.
However, then I get a cannot instantiate sercive CartService.
How can I create my own cart design with multiple rows and the checkout fields?
In your hemp site you have this beautiful animation when you click add to cart .. the circle that moves to the cart button on top. How do you do that ?
I see there is no possiblity to show / calculate tax per item per country yet
Every item can their own VAT %
Every country sets their own VAT levels.. so if I order from teh US I need to pay a different VAT than if I order from Europe
There is a typo in element\create
undefind => undefined
А зачем нужен parent_id ? у меня сразу с ним возникла ошибка ... так как он всегда у меня NULL... подправил базу что бы пропускал NULL.
И еще есть метод PUT у компонента - почему не сделать сразу UPDATE(id,Element) и DELETE(id)
Do you have a sample on how to implement the discount ?
The docs are not clear as where to include that code sniplet
This looks like a nice widget, but the columns are commented out...
Can you fix this so it resembles the hemp rows ?
It looks like you created an awesome extension, unfortunately I do not speak russian. Can you please make the documentation in English ?
Do you have a demo -site where I can see how your modules work
When I press the buy button I get
/cart/element/create 404 (Not Found)
Any Ideas ?
persent needs to be percent (C)
Currently you have your formatting done in multiple functions, better and more consistent is to have only one major formatting function
Something like this
function getCostFormatted()
{
return $this->format( $cost );
}
function getPriceFormatted
{
return $this->format( $price);
}
Line total : 200€
Cart total : 200 €
Nicer if there is a space between the number and the currency on the line total
При удалении элемента из корзины цена меняется через ajax. Я добавил два элемента - комиссия и сумма с учетом комиссии.
Добавил в defaultcontroller:
private function _cartJson($json)
{
if ($cartModel = yii::$app->cart) {
$json['elementsHTML'] = \pistol88\cart\widgets\ElementsList::widget();
$json['count'] = $cartModel->getCount();
$json['price'] = $cartModel->getCostFormatted();
$json['commission'] = 0.5;
$json['sum'] = $json['price']*(1+$json['commission'] );
} else {
$json['count'] = 0;
$json['price'] = 0;
}
return Json::encode($json);
}
То же самое в Elementcontroller в функции _cartJson().
В scripts.js изменил
renderCart: function(json) {
if(!json) {
var json = {};
jQuery.post('/cart/default/info', {},
function(answer) {
json = answer;
}, "json");
}
jQuery('.pistol88-cart-block').replaceWith(json.elementsHTML);
jQuery('.pistol88-cart-count').html(json.count);
jQuery('.pistol88-cart-price').html(json.price);
jQuery('.pistol88-cart-sum').html(json.sum);
jQuery('.pistol88-cart-commission').html(json.commission);
jQuery(document).trigger("renderCart", json);
return true;
},
post Обрабатывается нормально, данные передаются, но значения sum и commission не обновляются через ajax.
Подскажите, как сделать, что б эти поля тоже обновлялись через ajax?
When I delete 1 item in the cart, the entire card is dynamically removed (screen is empty)
Only after a reload the items that are still in the cart are displayed again
In my main menu I have placed a dropdown elementlist
Then in my checkoutpage I have a full elementlist.
However...
Now my checkoutpage has a menu with a dropdown elementlist
the full elementlist is no longer displayed by changed into an dropdown version.
How can I prevent that?
In my case, query
SELECT * FROM
cartWHERE
user_id=1
takes around 60-100ms
This is realy slow because field user_id has both user ids and hashes of sessions.
Only solution to fix that is to split sessions and ids in different columns so it could be possible to make indexes for them.
I see there is a widget that shows the dynamic price (when I increase the count). But is there also a version for the lineitem ?
So if I increase teh count , then that items total ( is also updated) like in the hemp site
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.