Skip to content

luanalves/Magento_FlagProducts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KASTERWEB Products Flag for Magento 1

Module developed to add images as product flags. This module does not contemplate customizing the front end.

Configure Module By Modman

To install Modman, you can either install the library in your user's root folder, or you can install Modman globally. Regardless of which option you choose, first run one of these two scripts to download the Modman repo.

bash < <(wget -q --no-check-certificate -O - https://raw.github.com/colinmollenhour/modman/master/modman-installer)

or

bash < <(curl -s -L https://raw.github.com/colinmollenhour/modman/master/modman-installer)

Init Modman

modman init

Clone project using modman.

modman clone https://github.com/luanalves/Magento_FlagProducts.git

Install by modman

modman run deploy-all

Run Setup Magento by N98

php n98-magerun.phar cache:clean ; php n98-magerun.phar sys:setup:run

Add entry ".modman" in .gitignore

Configure Flags

After running the module setup. The Kasterweb -> Manage Flags menu will appear. This menu will be responsible for registering the images of the flags.

After registering the flags, simply access the desired product and enter the desired flag.

Example of use

Add Code in Front End Page

<?php
$url = '';
if ($_product->getKasterwebFlag()) {
    if ($data = Mage::helper('kasterweb_flagproducts')->getPathFlagById($_product->getKasterwebFlag())) {
        if ($data) {
            if (is_array($data)) {
                foreach ($data as $key=>$item) {
                    echo  Mage::helper('kasterweb_flagproducts')->loadImageFlag($item,$_product,($key*10));
                }
            } else {
                echo  Mage::helper('kasterweb_flagproducts')->loadImageFlag($data,$_product);
            }
        }

    }
}
?>

Code CSS example

.flag {
    float: left;
    width: 50%;
    z-index: 10;
    position: absolute;
}

CATEGORY LIST


PRODUCT VIEW


About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages