Show Posts


Topics - Bard00k

Pages: [1]
1
Extensions and Add-Ons / Add async javascript tag
« on: August 01, 2016, 10:58:49 PM »
There are simple functions in Document class to add JavaScript tag to pages:

$document->addScript("some-script-url");

or

$document->addScriptBottom("some-script-url");

But I see it add scripts as sync, eg without the 'async' attribute.
How can I add a JavaScript tag in AbanteCart with async attribute?

Thanks,

2
Extensions and Add-Ons / Can't get product primary image
« on: July 18, 2016, 10:14:55 PM »
I'm trying to get the primary image URL of a product.
I tried the following code:

$resource = new AResource('image');
$sites = $sizes = array('main'  => array('width'  => 400, 'height' => 400));
$images = $resource->getResourceAllObjects('products', $product['product_id'], null, 1);

But $images is just an empty array.

Any ideas? Or maybe there's a more simple way to get product main image URL?

3
Hello everyone,

I'm trying to build an extension that includes an admin dashboard page and have its own button on the left navbar.
I tried the following code in my installation script (php):


$menu = new AMenu ( "admin" );
$menu->insertMenuItem ( array (  "item_id" => "extension_id",
                   "parent_id" => null,   
                   "item_text" => "Extension Name",
                   "item_url" => "extension_unique_name",
                   "item_type"=>"core",
                   "sort_order"=>"0")
               );

$data = array('language_id' => 0,
'section' => 1,
'block' => 'common/header',
'language_key' => 'extension_id',
'language_value' => 'Extension Name');


And it creates a menu like expected. However, now I want to set an icon instead of the default triangle.
I looked at the code and it expects a 'item_icon_rl_id' key, but I couldn't find in the doc what kind of value this param accept and where can I find a list of possible icon options?

Thanks! :)

Pages: [1]

Powered by SMFPacks Social Login Mod