{"id":1032244,"date":"2015-11-29T21:22:41","date_gmt":"2015-11-30T05:22:41","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/"},"modified":"2015-11-30T15:23:12","modified_gmt":"2015-11-30T23:23:12","slug":"bug-updating-cart-with-non-tribe-event-item-empties-the-cart","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/","title":{"rendered":"Bug: Updating Cart with non Tribe Event item empties the cart"},"content":{"rendered":"<p>We are using Tribe Event Tickets and trying to launch physical merch on the same woocommerce store.  I have been running into some issues, when I add Merch items to my cart, on the Cart page, after I press Update Cart, the cart would get emptied out.<\/p>\n<p>Here is the scenario:<br \/>\n-Add a Community ticket to your cart.  Add a phyiscal or (non Tribe Ticket line item) product to your cart.<br \/>\n-In the cart, increase the Qty of the product. Press Update Cart<\/p>\n<p>Expected:<br \/>\nBoth line items should be there with the update prices and quantity.<\/p>\n<p>Actual:<br \/>\nThe Tribe Event Ticket is there, but the product is emptied out.<br \/>\n&#8212;-<\/p>\n<p>I&#8217;ve tried this now with ONLY merch items, and the Update Cart not empties out the cart.  If I update the Ticket qty, the Tribe ticket is safe, but the other non Tribe Tickets get wiped out. <\/p>\n<p>I tracked it down to this filter in Main.php of community-events-tickets<br \/>\n<code>add_filter( &#039;woocommerce_stock_amount_cart_item&#039;, array( $this, &#039;enforce_purchase_limit_on_update&#039; ), 10, 2 );<\/code><\/p>\n<p>If I comment that filter out, then the merch quanitities are preserved.  I believe enforce_purchase_limit_on_update() function need to check whether $purchase_limit exists or not null since it seems to only apply to Tribe tickets and not all merch.  <\/p>\n<p>Please verify if you are seeing this behavior.  I am commenting it out for a launch tomorrow.   The risk will be that we will no longer be enforcing Ticket purchase limits, which sucks, but can wait till it is fixed.<\/p>\n<p>LMK, thx<\/p>\n","protected":false},"template":"","class_list":["post-1032244","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bug: Updating Cart with non Tribe Event item empties the cart -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bug: Updating Cart with non Tribe Event item empties the cart -\" \/>\n<meta property=\"og:description\" content=\"We are using Tribe Event Tickets and trying to launch physical merch on the same woocommerce store. I have been running into some issues, when I add Merch items to my cart, on the Cart page, after I press Update Cart, the cart would get emptied out. Here is the scenario: -Add a Community ticket [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-11-30T23:23:12+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/\",\"name\":\"Bug: Updating Cart with non Tribe Event item empties the cart -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-11-30T05:22:41+00:00\",\"dateModified\":\"2015-11-30T23:23:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Community Tickets\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/community-tickets\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Bug: Updating Cart with non Tribe Event item empties the cart\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bug: Updating Cart with non Tribe Event item empties the cart -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/","og_locale":"en_US","og_type":"article","og_title":"Bug: Updating Cart with non Tribe Event item empties the cart -","og_description":"We are using Tribe Event Tickets and trying to launch physical merch on the same woocommerce store. I have been running into some issues, when I add Merch items to my cart, on the Cart page, after I press Update Cart, the cart would get emptied out. Here is the scenario: -Add a Community ticket [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/","article_modified_time":"2015-11-30T23:23:12+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/","name":"Bug: Updating Cart with non Tribe Event item empties the cart -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-11-30T05:22:41+00:00","dateModified":"2015-11-30T23:23:12+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/bug-updating-cart-with-non-tribe-event-item-empties-the-cart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Community Tickets","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/community-tickets\/"},{"@type":"ListItem","position":5,"name":"Bug: Updating Cart with non Tribe Event item empties the cart"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1032244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1032244\/revisions"}],"predecessor-version":[{"id":1032336,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1032244\/revisions\/1032336"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1032244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}