Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I did a custom php rule with javascipt like this to open the shopping cart on "add to cart" click.
This code works and opens a window:
drupal_set_message('<script type="text/javascript">window.open ("/cart","mywindow","menubar=1,resizable=1,width=350,height=250");</script>','js-message');
But i wat to open the cart in a colorbox with this code:
drupal_set_message('<script type="text/javascript">
(function ($) {
$(document).ready(function(){
$.fn.colorbox({href:'/cart', open:true, iframe:true, width:817, height:500,overlayClose: false, escKey:false}
);
});
}(jQuery));
</script>','js-message');
Whats wrong?
Is the a other way to get same results maybe without rules??
Comments
Comment #1
frjo CreditAttribution: frjo commentedComment #2
frjo CreditAttribution: frjo commented