Skip to content

Instantly share code, notes, and snippets.

View janssens's full-sized avatar
🥕
"Pachamama t'appelle, bro"

Janssens Gaëtan janssens

🥕
"Pachamama t'appelle, bro"
View GitHub Profile
@jonatanrdsantos
jonatanrdsantos / magento-get-product-options.php
Last active November 13, 2020 14:13
Magento get product Options
<?php
$productSku = "27609";// the SKU example
$productId = Mage::getModel('catalog/product')->getIdBySku( $productSku );
/** @var $product Mage_Catalog_Model_Product */
$product = Mage::getModel('catalog/product')->load($productId);
/** @var $option Mage_Catalog_Model_Product_Option */
$option = $product->getOptionById('10190');
foreach ($option->getValues() as $_value) {
/** @var $_value Mage_Catalog_Model_Product_Option_Value */
@DarrylDias
DarrylDias / default
Last active November 6, 2021 23:32
NGINX configuration for Grav CMS.
server {
listen 80;
server_name localhost; # Change this with your domain name
root /var/www/grav; # The place were you have setup your Grav install;
index index.php;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
@manojiksula
manojiksula / magento.md
Last active September 28, 2023 12:49
Magento Code Snippet

Base Url acording to request http or https

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB,array('_secure'=>Mage::app()->getStore()->isCurrentlySecure()));

Check if Secure URL is enabled in Frontend

if (Mage::app()->getStore()->isFrontUrlSecure()) {
    echo 'Secure URL is enabled in Frontend';
} else {