Javascript expert

Add the below script to the bottom of the body tag.

(function($,undefined) {

  $(document).ready(function() {
  
    if(window.fancyProductDesigner !== undefined) {
    
      fancyProductDesigner.on('elementAdded',function(evt,fabricImage) {
      
        alert('Image Added!');
      
      });
    
    }
  
  });


})(jQuery);

Once you do that you should see an alert each time an image is added to the canvas. This is the first step to the process. Once that is confirmed the next step well to to detect facebook image and apply the roudned corners via the fabric image api. I haven’t quite worked out the details on that piece of it yet.

For anyone else who wants to help the fabricImage variable will be an instance of this.

Perhaps fabric has a dedicated forum where you can specifically ask how to apply rounded corners to an instance of fabric.Image.

1 Like

thanks a lot!

With php-tags ? If yes, its not working. I get a blank page

No, inside JavaScript tags of course. It’s JavaScript not PHP

okay sorry, I tried it with JavaScript now - I dont get an altert.

PS: I found this one:
http://fancyproductdesigner.com/woocommerce-plugin/documentation/developers/
is this maybe helpful?

It seems to add a class to the body tag, but that’s only useful for styling the page the canvas appears on, rather than the canvas elements themselves.

1 Like

Unless you present the actual page where we can see everything in action it is hard to say what could be the issue. Having said that are there any errors in the console?

no errors.

I cant send pn’s I would send you the link. But as I said. nothing happens and no errors.

You can simply post hte link here - that way everyone sees it. This is a forum: this is a PUBLIC place to get help :slight_smile: .

not allowed to do that :smiley: …its a startup

is there a way to send you a pn?

“New” members can’t send PMs.

Read a few other topics and you should get to “Basic” soon and you will then be able to send PMs, upload images, and a few other things too.

1 Like

reading or write 1000 topics :wink:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.