Adding to cart problem

pros's picture
pros
Sun, 08/20/2017 - 08:25
#1
Adding to cart problem


Can you help me solve this problem and send instructions or updated files?

cindy's picture
cindy
Mon, 08/21/2017 - 00:41

Hi,

Please backup your database and source code and send us your website url, admin account and your FTP account

We would like to check and fix this issue

cindy's picture
cindy
Tue, 08/22/2017 - 05:31

Please send us the page url which has filter (in your video above)

cindy's picture
cindy
Wed, 08/23/2017 - 23:37

We fixed already

Please check

pros's picture
pros
Thu, 08/24/2017 - 15:21

Adding to cart not working fully. When adds a product found on the first page, it works, but when I added a product, which is on next this is not working. There are also some other ajax errors

cindy's picture
cindy
Thu, 08/24/2017 - 22:47

Hi,

We search your product at page 2 but see no result 

Your search seems to have problem

Please check

pros's picture
pros
Sat, 08/26/2017 - 17:32

I fixed my search changing in view full pager to mini (in mini pager ajax is working). Adding to cart i fix by this code added to template.php 

function md_brilliant_form_alter(&$form, &$form_state, $form_id) {
  if (strpos($form_id, 'commerce_cart_add_to_cart') !== FALSE) {
    $query = drupal_http_build_query(drupal_get_query_parameters());
    $form['#action'] = base_path() . current_path() . '?' . $query;
  }
}

Now i have only one little problem. When i add product from second page code above adding to URL parameter ?page=1 and after that when i want to search another product i cant see result. The problem is the parameter added by the function. Do you know how to remove this parameter after adding it to the cart so that the search works?

Tell me, please, how you solved ajax error problem (from my video above)?

Thank you in advance

cindy's picture
cindy
Sun, 08/27/2017 - 23:15

Hi,

Please open file product-filter.js (in folder sites\all\modules\custom\md_theme\js) and add the following code into function $( document ).ajaxComplete(function() {....});

$(".commerce-add-to-cart").each(function() {
var array = $(this).attr("action").split('?');
if(array[1] != "") {
var url = Drupal.settings.md_brilliant.baseUrl + "?" + array[1];
$(this).attr("action", url);
} else {
var url = Drupal.settings.md_brilliant.baseUrl;
$(this).attr("action", url);
}
});
Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.