texts: Magento 2 : Upload product image programatically

texts:
I am new to Magento and i want upload upload product programmatically along with product image, i am using this code to implement, please check

try{
$_product->setName($product["name"]);
$_product->setTypeId('simple');
$_product->setAttributeSetId(4);
$_product->setSku($product["sku"]); // this must be unique everytime and get the exception in frontend
$_product->setWebsiteIds(array(1));
$_product->setVisibility(4);
$_product->setDescription($product["description"]);
$_product->setPrice($product["price"]);

//$imagePath = $product['imgpath'];

$_product->setMediaGallery(array('images'=>array (),'values'=>array ()));
$_product->addImageToMediaGallery('https://beebom-redkapmedia.netdna-ssl.com/wp-content/uploads/2016/01/Reverse-Image-Search-Engines-Apps-And-Its-Uses-2016.jpg', array('image', 'small_image', 'thumbnail'),false);
// $_product->setImage('https://beebom-redkapmedia.netdna-ssl.com/wp-content/uploads/2016/01/Reverse-Image-Search-Engines-Apps-And-Its-Uses-2016.jpg');

// $_product->setSmallImage('/testimg/test.jpg');

// $_product->setThumbnail('/testimg/test.jpg');
$_product->setStockData(array(
        'use_config_manage_stock' => 0, //'Use config settings' checkbox
        'manage_stock' => 1, //manage stock
        'min_sale_qty' => 1, //Minimum Qty Allowed in Shopping Cart
        'max_sale_qty' => 2, //Maximum Qty Allowed in Shopping Cart
        'is_in_stock' => $product['stockstatus'], //Stock Availability
        'qty' =>  $product['quantity']
        )
    );
$_product->save();
}
catch(\Exception $e) {
 echo $e->getMessage();
}

i provided the static path for the image and its opening in the browser, but getting error The image does not exist. while uploading product.
please suggest.


texts: Including PHP Class in Magento 2 Controller

texts:
I have this 3rd party class Mailchimp.php which I need to include in my controller so that I can create an object and make api calls. But I'm not able to do so. I get this error when I try to run my controller.

Class 'Mailchimp' not found in /var/www/html/magentotwo/app/code/Vss/Mailchimp/Controller/Index/Add.php

I've installed mailchimp through composer through following command

  composer require drewm/mailchimp-api

and can find the library in my magento's vendor folder.

Following is the code of my controller:

<?php

namespace Vss\Mailchimp\Controller\Index;

use Mailchimp;

class Add extends \Vss\Mailchimp\Controller\Index\Index
{

    public function execute()
    {
        $api_key = $this->_scopeConfig->getValue('mailchimp/apikey/api_key_frontend', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
        $MailChimp = new Mailchimp($api_key);
        $result = $MailChimp->get('lists');
        print_r($result);
    }
}
?>

Following is the folder structure of library installed

Please tell me how to proceed further.


texts: Overwriting a modules overwritten extended class

texts:
I've created a quick module to extend Mage_Catalog_Block_Layer_View Class::getFilterableAttributes() which works just fine.

However I need the funtioality of Amastys improved navigation module aswell which sacks off the getFilterableAttributes method for it's own _getFilterableAttributes method.

Now I can easily set a depends on my module to load first however I'm getting confused as the class that defines the _getFilterableAttributes method doesn't extend a Magento base class, it extends an abstract that in turn extends another class.

/Model/Catalog/Layer.php

class Test_BrandCategories_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
{

    protected function _getFilterableAttributes()
    {
        Mage::log('Running...', null, 'ahoy_brand.log');

        $attributes = $this->getData('_filterable_attributes');
        if (is_null($attributes)) {
            $settings   = $this->_getDataHelper()->getAttributesSettings();
            $attributes = Mage::helper('amshopby/attributes')->getFilterableAttributes();
            foreach ($attributes as $k => $v){
                $pos = 'left';
                if (isset($settings[$v->getId()])){
                    $pos = $settings[$v->getId()]->getBlockPos();
                }
                elseif($v->getAttributeCode() == 'price'){
                    $pos = Mage::getStoreConfig('amshopby/block/price_pos');
                }
                if ($this->_notInBlock($pos)){
                    unset($attributes[$k]);
                }
            }

            $this->setData('_filterable_attributes', $attributes);
        }

        return $attributes;
    }
}

Amasty/Shopby/Block/Catalog/Layer/View.php

class Amasty_Shopby_Block_Catalog_Layer_View extends Amasty_Shopby_Block_Catalog_Layer_View_Adapter
{

    ...

    protected function _getFilterableAttributes()
    {
        $attributes = $this->getData('_filterable_attributes');
        if (is_null($attributes)) {
            $settings   = $this->_getDataHelper()->getAttributesSettings();
            $attributes = Mage::helper('amshopby/attributes')->getFilterableAttributes();
            foreach ($attributes as $k => $v){
                $pos = 'left';
                if (isset($settings[$v->getId()])){
                    $pos = $settings[$v->getId()]->getBlockPos();
                }
                elseif($v->getAttributeCode() == 'price'){
                    $pos = Mage::getStoreConfig('amshopby/block/price_pos');
                }
                if ($this->_notInBlock($pos)){
                    unset($attributes[$k]);
                }
            }

            $this->setData('_filterable_attributes', $attributes);
        }

        return $attributes;
    }

    ...

}

Amasty/Shopby.Block/Catalog/Layer/View/Adapter.php

if (Mage::helper('amshopby')->useSolr()) {
    class Amasty_Shopby_Block_Catalog_Layer_View_Adapter extends Enterprise_Search_Block_Catalog_Layer_View {}
} else {
    class Amasty_Shopby_Block_Catalog_Layer_View_Adapter extends Mage_Catalog_Block_Layer_View {}
}

Because of this extended extension and the custom method name pretended with an _ I'm really not sure what to do, I really don;t want to modify the Amasty plugin if possible but i know I may need to comment out the offending function or something similar. But after looking up solutions for a while I've not found an example that features a nested extension.


texts: Magento 1.9 : Update native field properties

texts:
I've just finished building an extended password policy module, which allows for customisable control over the rules for creating/updating a password.

The general idea is that you can set the minimum characters, whether the password should contain a special character, uppercase character, etc...

The module works as expected, however, there is no indication to the admin what rules he needs to follow when creating/updating an account.

I've found the form I need to update, Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Main, and the field that needs editting and the property that needs adding:

$fieldset->addField('password', 'password', array(
    ....
    'after_element_html' => '<small># Output Rules Here #</small>',
));

My problem is I don't really want to extend the Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Main class and rewrite the entire _prepareForm() method, it'd be preferable to target that particular form and that particular field and update the properties, but I can't seem to find out if that is even possible.

Any help would be appreciated.


texts: Magento2 : How to bind custom Knockout Method to a data-bind?

texts:
I need the product URL for each product in the checkouts cart.

Therefore I want to edit vendor/magento/module-checkout/view/web/templates/summary/item/details.html and add my custom method there, lets call it myMethod.

This is how my code looks like right .

However, in a console, i have the log that there's no function called myMethod. Logic!

How can I create myMethod in Order to let it work? Where do I need to inject my JS?

What do I want to do? For legal reasons, I need the URL of the product. I want KO to do my request by calling an ajax file that returns the URL of the product and then links it. The final code in details.html will look like this:

In onepage.phtml I've added the following to test, but it does not work:

How can I achieve what I what?


texts:
I got this error when trying to deploy my site on server:

  Internal Server Error : The server encountered an internal error or
  misconfiguration and was unable to complete your request.

  Please contact the server administrator, root@localhost and inform
  them of the time the error occurred, and anything you might have done
  that may have caused the error.

  More information about this error may be available in the server error
  log.

Apache/2.2.15 (CentOS) Server at 196.203.63.32 Port 80
I am working with magento 2.2.6.
Thanks in advance.


texts: 'Bank Transfer Payment' Sort Order setup for each store view

texts:
I want to setup different sort order for 'Bank Transfer Payment' payment method

I found sort order option is only available on Default store view, not each language store view

This is a language store view, there is no option for 'Sort Order'

How can I make to setup sort order option for each store view?

Magento 1.8.1


texts: extension failed to open stream: No such file or directory

texts:
I have Installed a Magento Extension, after that I have error failed to open stream: No such file or directory I don't know why?

Thank you


texts: CSS / HTML / JS not updating XAMPP (local development) - Magento 2

texts:
I've tried to install Magento 2 locally using XAMPP. This works fine, except for the fact that when I alter my CSS, HTML or JS, XAMPP won't get the updated files. It just takes the file I initially created with it's content, but not the updated version.

I think this has something to do with caching of Apache itself?
I read something about disable cache using .htaccess (http://httpd.apache.org/docs/2.0/mod/mod_cache.html) but I can't figure out how to implement this.

Anyone knows how I can fix this?

Flushing cache doesn't work.
Deploy static content may work, but I don't want to do that every time I make one minor change in the CSS (when I worked remotely, I did not have to do that either)

Developer mode is enabled.


texts: How to handle click event on configurable product attribute swatch on product page?

texts:
How can i handle click event on configurable product attribute on product page.  i am trying to below code but its not work.

<script type="text/javascript">
        require(['jquery'],function($){
            $("document").ready(function(){
                var data = '<?php echo $block->getJsonConfig(); ?>';
                var itemValue = JSON.parse(data);
                var optionCollection = itemValue.index;
                jQuery(".swatch-option").click(function(){
                    var optionId = $(this).attr("option-selected");
                    alert(optionId);
                });
            });
        });
</script>


texts:
My magento is not sending contact form for my e-mail, the other sales e-mails is working/sending normally, i checked the crons and system > Configuration > Store email adresses, checked Contacts too,

when i write the contact form and press button "send", it returns success for form.

the url comes to mydomain.com/contacts/index/

i'm using http in a shared host,
Php version 7.0

i Try to follow this post Contact Form Not Working or Displaying Confirmation / Failed Message    but it does not work too.


texts: Send Transactional Email with file Magento

texts:
Hi I create cusrom form(frontend). And I want to sent Transactional Email with file .

Below is IndexController and file template send_email.phtml

IndexController:

<?php

class Send_Email_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        //Get current layout state
        $this->loadLayout();

        $block = $this->getLayout()->createBlock(
            'Mage_Core_Block_Template',
            'email.simple_contact',
            array(
                'template' => 'send_email/simple_contact.phtml'
            )
        );

        $this->getLayout()->getBlock('content')->append($block);
        //$this->getLayout()->getBlock('right')->insert($block, 'catalog.compare.sidebar', true);

        $this->_initLayoutMessages('core/session');

        $this->renderLayout();
    }

    public function sendemailAction()
    {
        if ($error) {
            throw new Exception();
        }

        //Fetch submited params
        $params = $this->getRequest()->getParams();

        $mail = new Zend_Mail();
        $mail->setBodyText($params['comment']);
        $mail->setFrom($params['email'], $params['name']);
        $mail->addTo('somebody_else@example.com', 'Some Recipient');
        $mail->setSubject('Test Email Module for Magento');
        try {
            $mail->send();
            Mage::getSingleton('core/session')->addSuccess('send email.');
        }
        catch(Exception $ex) {
            Mage::getSingleton('core/session')->addError('Unable to send email.');

        }

        //Redirect back to index action of (this) inchoo-simplecontact controller
        $this->_redirect('email/');
    }
}

template send_email.phtml:

    <form id="simple_contact_form" name="simple_contact_form" action="<?php echo $this->getUrl('email/') ?>index/sendemail" method="post" enctype="multipart/form-data">

        <fieldset class="group-select">

Simple Contact Form

                        Gimme your name *

                        <input name="name" id="name" title="Name" value="" class="input-text required-entry" type="text" />

                        And your email *

                        <input name="email" id="email" title="Email" value="" class="input-text required-entry validate-email" type="text" />

                    <?php echo Mage::helper('contacts')->__('Attachment') ?>

                        <input name="MAX_FILE_SIZE" type="hidden" value="2000000" />
                        <input name="customerimg" id="attachment" class="input-text" type="file" />

        </fieldset>

           <button type="submit" title="Submit" class="button">Submit</button>

    </form>


texts: Buy 2 specific products and get one specific product free

texts:
been trying to set this up but need some guidance, we are running an offer where if the customers add products X and Z to the cart product Y will be free of charge. Is this possible via the build in system in Magento or do I need a extension for this?

Magento version: 1.9.2.1


texts: Magento 2.3.1 - Changed PayPal Express Button

texts:
The Magento 2.3.1 upgrade changed our product page's PayPal Express button to an Iframe and we can't seem to revert the changes through the admin interface. We had configured the PayPal Express button to be modified through:

app/design/frontend/theme/default/Magento_Paypal/templates/express/shortcut.phtml

where we modified the button's image

...src="<?= $this->getViewFileUrl('images/paypalicon.png'); ?>"...

This seems to be a direct result of the 2.3.1 version's PayPal changes and the new frontend Smart Buttons that we'd like to disable, but we already have:

Customize set to No in PayPal Express Settings > Advanced Settings > Frontend Experience Settings > Product Page
We also have "No logo" set in PayPal Express Settings > Advanced Settings > Frontend Experience Settings

You can see the change below:

Any suggestions or feedback would be greatly appreciated. Thanks!


texts: Edit Label on Order Totals Block on Admin

texts:
I have installed a module called "Magentix" on my site.
I want to edit the Label on the Order:

What would be the path and file? I couldn't find it.
Thanks


texts: Removing a subcategory from the menu doesn't remove it

texts:
In my menu I've got 4 items:

Products
Services
About Us
Contact Us

I want to delete the About us, so I went to magento 2 -> Admin -> Catalog -> Categories -> Categories -> About Us -> Delete

It still shows up on the website, I empty my cache, magento's cache and nothing happens..

Why is this happening?


texts:
I'm using this code to send an email in Magento.

public function send()
    {
        $config = array('ssl' => 'tls',
        'port' => 587,
        'auth' => 'login',
        'username' => '[ME]@gmail.com',
        'password' => '[PASS]');

        $transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);

        if (Mage::getStoreConfigFlag('system/smtp/disable')) {
            return $this;
        }

        $mail = new Zend_Mail();

        if (strtolower($this->getType()) == 'html') {
            $mail->setBodyHtml($this->getBody());
        }
        else {
            $mail->setBodyText($this->getBody());
        }

        $mail->setFrom($this->getFromEmail(), $this->getFromName())
            ->addTo($this->getToEmail(), $this->getToName())
            ->setSubject($this->getSubject());
        $mail->send($transport);

        return $this;
    }

This works fine, but, the people who receive the email can see that it's sended by: [ME]@gmail.com how can I change this in the Zend mailer?


texts: How to display product descriptions automatically in mobile version?

texts:
We are using 1.9.0.1, the rwd theme.

By default, you need to click "Description" when viewing a product on your phone, and then the description will drop down and show.

I feel like a lot of customers glance over this, and I would like the description to load automatically.

Is there a way to do this?

Thanks


texts: Magento 2.4 - Elastic Search Out of Stock products at end of Product Listings

texts:
I need to display Out of Stock products at end of the Listing in category page. I have overided the SetCollection method  in Toolbar.php using around method(upto magento 2.3.5 without elasticsearch it worked fine). But it is not working with Elastic Search.
<?php
 namespace Vendor\Module\Plugin\Product\ProductList;

class Toolbar
{
/**
 * Around Plugin to set the order collection based on sort type
 *
 * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $subject
 * @param \Closure $proceed
 * @param \Magento\Framework\Data\Collection $collection
 * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
 */
public function aroundSetCollection(
    \Magento\Catalog\Block\Product\ProductList\Toolbar $subject,
    \Closure $proceed,
    $collection
) {
    $currentOrder = $subject->getCurrentOrder();
    $currentDirection = $subject->getCurrentDirection();
    $result = $proceed($collection);
    $this->_collection = $collection;

    /* To Move out of stock product at the end */
    $orderBy = $subject->getCollection()->getSelect()->getPart(\Zend_Db_Select::ORDER);
    $outOfStockOrderBy = array('is_salable DESC');
    $subject->getCollection()->getSelect()->reset(\Zend_Db_Select::ORDER);
    $subject->getCollection()->getSelect()->order($outOfStockOrderBy);

    }

    //print_r($subject->getCollection()->getSelect()->getPart(\Zend_Db_Select::ORDER));die;
    return $result;
 }

}

Is there any other way to achieve that ?


texts:
I see in the di.xml files from the core that some of the arguments have the type init_parameter but the values of the parameters are all constants.

<type name="Magento\Framework\View\Page\Config\Renderer">
    <arguments>
        <argument name="appMode" xsi:type="init_parameter">Magento\Framework\App\State::PARAM_MODE</argument>
    </arguments>
</type>

or this one

<type name="Magento\Framework\App\Cache\State">
    <arguments>
        <argument name="banAll" xsi:type="init_parameter">Magento\Framework\App\Cache\State::PARAM_BAN_CACHE</argument>
    </arguments>
</type>

and many others.
But from what I see in the interpreter associated to init_parameter, the constant interpreter is used Magento\Framework\App\Arguments\ArgumentInterpreter::evaluate

public function evaluate(array $data)
{
    return ['argument' => $this->constInterpreter->evaluate($data)];
}

But the result is a bit different from the Magento\Framework\Data\Argument\Interpreter\Constant::evaluate

 public function evaluate(array $data)
{
    if (!isset($data['value']) || !defined($data['value'])) {
        throw new \InvalidArgumentException('Constant name is expected.');
    }
    return constant($data['value']);
}

Can someone explain please how the init_parameter type works and how everything happens under the hood?


texts:
The special_to_date attribute in Magento caused an error in the catalog->products so I decided to remove the record in EAV_Attribute table ?
The error disappeared but I wanna to restore the attribute since this is a system attribute.

I did this INSERT (copying the record from a backup) but I get an error:

SQL Query:

INSERT INTO  `magento_back`.`sm_eav_attribute` (
 `attribute_id` ,
 `entity_type_id` ,
 `attribute_code` ,
 `attribute_model` ,
 `backend_model` ,
 `backend_type` ,
 `backend_table` ,
 `frontend_model` ,
 `frontend_input` ,
 `frontend_label` ,
 `frontend_class` ,
 `source_model` ,
 `is_required` ,
 `is_user_defined` ,
 `default_value` ,
 `is_unique` ,
 `note`)
VALUES (
NULL ,  '4',  'special_to_date', NULL ,  'eav/entity_attribute_backend_datetime',  'datetime', NULL , NULL ,  'date',  'Special Price To Date', NULL , NULL , '0',  '0', NULL ,  '0', NULL);

  1062 - Duplicate entry '4-special_to_date' for key 'UNQ_SM_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE'

How can I solve this error?


texts: How to migrate Nexternal eCommerce site users to Magento 1.9?

texts:
I am using a Nexternal eCommerce site. Is there any tool or service available for migrating from Nexternal eCommerce site to my new Magento 1.9 site?
Thanks in Advance


texts: How can host magento at example.com/path/to/magento?

texts:
this kind is a simple question still I'm struggling to figure out how to achieve this.

I have a landing page, and if the user clicks to enter a certain section I want him to see the store (located at /magento).

When I'm installing magento through the command line there's a baseURL argument, what I should put in there? My intuition is it should be example.com/magento, but I get errors.

Maybe I'm not configuring nginx properly. Here's my super simple config:

server {
    listen                      80 default_server;
    listen                      443 default_server ssl;

    ssl_certificate             /etc/nginx/ssl/cert.pem;
    ssl_certificate_key         /etc/nginx/ssl/key.pem;

    client_max_body_size        10M;

    root /var/www/html;

    location ./magento {
            index index.php;
    }
}

I tried using baseURL as example.com and example.com/magento, I also tried removing the location ./magento... from nginx. I will get either 404 or 403.

Any ideas on how tho achieve this goal? Thanks.


texts: Magento 2. Add attribute to Catalog Price Rule

texts:
Is it possible to add additional (simple string) attribute to the Catalog Price Rule? If it is, please, tell about it in details. Better with working code example.

[UPD]

I mean add attribute to the price rule itself.


texts: Magento 1.9 Admin notification bar display 502 bad gateway

texts:
My Magento 1.9 admin suddenly show a 502 bad gateway message. What is wrong? It says nginx, but my Magento is running on Apache server.

I do have a nginx server running besides Apache. But the message still displays even if I stop the nginx service.


texts: Admin: get data from sales_flat_order_address

texts:
How can I get a field from sales_flat_order_address and use it in sales admin view?
I've got a boolean field and i like to add a code if it is true

<?php if ($myattribyte = 1): ?>
   <p> Some text</p>
<?php endif;?>


texts: How can I use weight in actions condition for shopping cart price rule?

texts:
I would like to use a rule involving shipping weight. I have set Use for Promo Rule Conditions to yes. It does not show up. Any other attribute works fine.

After some research I found this- https://stackoverflow.com/questions/22172746/magento-cant-use-attribute-weight-in-actions-condition-for-shopping-cart-price

"I don't know if this is a bug or a feature, but it seams like you cannot use the weight attribute for the rule conditions and actions.
When checking if an attribute is valid for rules this method is called

Mage_Catalog_Model_Resource_Eav_Attribute::isAllowedForRuleCondition

public function isAllowedForRuleCondition()
{
$allowedInputTypes = array('text', 'multiselect', 'textarea', 'date',     'datetime', 'select', 'boolean', 'price');
return $this->getIsVisible() && in_array($this->getFrontendInput(), $allowedInputTypes);
}

This seams reasonable. Now the strange part.
The weight attribute has the frontend input weight.
You can see this by running this query on the db.

SELECT * FROM eav_attribute where attribute_code = 'weight'.

Changing the frontend_input to text makes the attribute available in promo rules. But I can't tell you if this is a good idea or not."

Has anyone tried this? I hate modifying any core files. The strange part is others that have text field selected, work just fine. It is just weight I have the issue with.


texts: I am using Magento 2. I am trying to edit a product. But the Product Save button is not working.


texts: Magento 2 create product duplicate Image are Doubled Issues

texts:
when saving product with the duplicate in Magento 2 then
images are double like,

Pics get doubled when duplicating an item, so the duplicated item has two images. If you duplicate that then the new item has four images. We just need one image when duplicating an item.

If any suggestion then let me know,

please ASAP,

Thanks,


texts: Why Mage::getModel() is not using for resource model classes?

texts:
This is a code snippet from app/code/core/Mage/Catalog/etc/config.xml.

<config>
..............
    <global>
            <models>
                <catalog>
                    <class>Mage_Catalog_Model</class>
                    <resourceModel>catalog_resource</resourceModel>
                </catalog>
                <catalog_resource>
                    <class>Mage_Catalog_Model_Resource</class>
                    <deprecatedNode>catalog_resource_eav_mysql4</deprecatedNode>
                    <entities>
                        <product>

catalog_product_entity

                        </product>
................
</config>

We can create Mage_Catalog_Model_Porduct object as

$model = Mage::getModel('catalog/product');

Same way can create the resource model object as follows.

$resourceModel = Mage::getModel('catalog_resource/product');

I know basically there's already a function as Mage::getResourceModel();.
Example: Mage::getResourceModel('catalog/product');

But this way is also works fine.

Can anyone explain why not using Mage::getModel() to get the resource model object ? Any suggestions will be appreciated.


texts: Magento 2 order status changing to pending again

texts: I have created my own order status return. If the user return one shipment the order status is changing to return but on making another shipment of same order it changes the order status to pending again. I have assigned it to processing. It should remain to return on making another shipment also. How to achieve that?


texts:
I am currently working on an ecommerce website; the website is built in Magento. The website has tons of configurable products with associated simple products. For each simple product, we have different images. We are using canonical URLs on the simple product to refer to the main product (configurable product) so that Google doesn't have to index the simple products individually.

My question is this: do we need the ALT tag for every single image for simple products, or since we are using canonical URLs, do we not need ALT tags for simple product.

Thanks.


texts:
I have Magento 1.9.3.6 running on PHP 5.6 (not sure if that is important).  My website is running very slow and when I asked the host company if they could investigate, they said it was session queries that were causing the problem.

Can someone help me with this?  I'm not a database person and I'm trying to figure out what is causing this.

Thank you... Vicky

The exact message as follow:

==========

1225 xgfmzkpgk      localhost xgfmzkpgks        300  Query updating DELETE FROM `mgik_core_session` WHERE (session_expires < 1521477610)
    1337 xgfmzkpgk      localhost xgfmzkpgks        198  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1374 xgfmzkpgk      localhost xgfmzkpgks        182  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1396 xgfmzkpgk      localhost xgfmzkpgks        160  Query updating UPDATE `mgik_core_session` SET `session_expires` = '1521481350', `ses
    1399 xgfmzkpgk      localhost xgfmzkpgks        156  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1400 xgfmzkpgk      localhost xgfmzkpgks        145  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1405 xgfmzkpgk      localhost xgfmzkpgks        144  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1406 xgfmzkpgk      localhost xgfmzkpgks        142  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1410 xgfmzkpgk      localhost xgfmzkpgks        132  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1417 xgfmzkpgk      localhost xgfmzkpgks        121  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1421 xgfmzkpgk      localhost xgfmzkpgks        111  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1422 xgfmzkpgk      localhost xgfmzkpgks        111  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1428 xgfmzkpgk      localhost xgfmzkpgks        94  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1429 xgfmzkpgk      localhost xgfmzkpgks        90  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1430 xgfmzkpgk      localhost xgfmzkpgks        87  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
      982      root      localhost xgfmzkpgks        80  Query System l CHECK TABLE `mgik_log_visitor`


texts: Add a product to wishlist of Customers in particular group

texts:
I am trying to add a product to wishlist of all customer in a particular group.

Currently I have added products to a particular customer's wishlist.

That I have to add to a particular group of customers.

Can anyone guide me regarding this ?


texts: How to make connection between SAP and magento

texts: How can I achieve the connection between  SAP  and Magento  using API


texts:
I need to create my own UI library (mostly .less files, but also images and .js) which will be used in multiple custom modules and themes. I thought I will just add my files to Magento UI library which is located under /lib/web.

But first of all, is it allowed (and is it a good practice) to add custom files in /lib/web?
If I add there custom files, should I create there my own folder (e.g. with my company name) such as /lib/web/company to keep all my custom files separated from Magento default files?

For example:

lib/
├── web/
│   ├── css/
│   │   ├── source/
│   ├── fonts/
│   ├── jquery/
│   ├── company/
│   │   ├── css/
│   │   │   ├── source/
│   │   ├── fonts/
│   │   ├── jquery/

Or should I create custom folder inside each of the default folders? Like this:

lib/
├── web/
│   ├── css/
│   │   ├── source/
│   │   ├── company/
│   │   │   ├── source/
│   ├── fonts/
│   │   ├── company/
│   ├── jquery/
│   │   ├── company/

Documentation

I've checked documentation about UI library, but it's not clear to me where custom files should be placed: https://github.com/magento/magento2/blob/2.0/lib/web/css/docs/source/README.md

Example 1 (link):

  Global variables

  If variables are common for couple themes it should be located in global lib in _variables.less file

I assume we should never edit the default the core files. So do they mean that I should create my own folder for the file with custom variables? Where exactly?

/lib/web/company/css/source/lib/_variables.less

/lib/web/css/company/source/lib/_variables.less

/lib/web/css/source/company/lib/_variables.less

/lib/web/css/source/lib/company/_variables.less

Example 2 (link):

  Extends that used in more than one theme should be saved in lib lib/source/utilities.less (will be separated into utilities folder)

This suggests that custom mixins should be placed in a new file utilities.less inside a new sub-directory /lib/web/css/source/lib/source. Is that correct?

But they don't say if I should create my own folder there.


texts: getImage by Label not working in Bundle item

texts:
I want to get the image by its label, inside a bundle product's each options selection item. Each selection item is a simple product.

echo Mage::getModel('catalog/product')->load($product_id)
    ->getMediaGalleryImages()->getItemByColumnValue('label', $preview_label_standing)
    ->getUrl();

The file I am calling the above code is from the path app\design\frontend\myCustomPackage\myCustomTheme\template\bundle\catalog\product\view\type\bundle\option\radio.phtml. Here $product_id contains simple product id and $preview_label_standing contains the label i have given for my image from the backend.

P.s. And I want to add one more thing the same code is working in my localhost, but not in server :(

Many thanks in advance.


texts: Magento 2.0.2 - Steps to see custom theme

texts:
By following other tickets and documentation. I have been able to see new custom theme in admin section based on the next steps:

Here the steps I have done:

I have created folder structure under 'Magentoroot'/app/design/frontend/myvendor/mytheme/

.

Then I have added file: 'theme_dir'/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>My Theme</title> <!-- your theme's name -->
     <parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
     <media>
         <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
     </media>
 </theme>

  .

Then I have added file: 'theme_dir'/composer.json

{
    "name": "myvendor/theme-frontend-mytheme",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/theme-frontend-blank": "100.0.*",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-theme",
    "version": "100.0.1",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    } }

.
4. Then I have added file: 'theme_dir'/registration.php :

<?php /**  * Copyright © 2016 Magento. All rights reserved.  * See COPYING.txt for license details.  */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/myvendor/mytheme',
    __DIR__ );

.

Then I updated ''/dev/tools/grunt/configs/themes.js - just below luma:

luma: {
    area: 'frontend',
    name: 'Magento/luma',
    locale: 'en_US',
    files: [
        'css/styles-m',
        'css/styles-l'
    ],
    dsl: 'less'
},
mytheme: {
    area: 'frontend',
    name: 'myvendor/mytheme',
    locale: 'en_US',
    files: [
        'css/styles-m',
        'css/styles-l'
    ],
    dsl: 'less'
},

.

Then deleted var from root
Then I flushed cache
Then I ran from CLI - in this step the new theme was not shown in logs:
magento setup:static-content:deploy
Then when I go to Admin/Content/Themes and I am able to find new theme.


texts: How to get memory_limit to be recognized by Magento when doing readiness test

texts:
I have had a terrible time getting extensions installed due to a readiness check. Magento fails to recognize that I have changed the php memory_limit figure.

This post applies but doesn't work. It seems like it would. I am stuck.
setup-cron.ERROR: real memory limit 756M but 512M in log

Any thoughts?


texts:
my site www.hafeezpk.com is not open in https://gtmetrix.com/ please tell me how to fix this issue

https://gtmetrix.com/?job_error=UlsCBd7H


texts: I need to edit the pdf creditmemo generated from backend with the print button. I don't find the template. What is the path?


texts: Show all articles of a category in cms static block?

texts:
Is it possible to load all products of a category in a CMS static block?

Maybe there is a CMS Block which I can use?


texts: Magento 2 Change Url Key on new product save

texts:
How can I programmatically change URL-key on product save?
I need url-key as a first brand and product name (/brand-productname)


texts: Binding Events On Dynamically Generated DOM Elements Knockout + Magento 2

texts:
I am working on a module where i have generated few DOM elements dynamically. But when i am trying to call certain function on some events then its not getting called. Here is the code sample. Here you can see i am calling getData method on "change" event but its not being called

getData: function() {
            var data = this._super();
            data.additional_data.bank_type = $('input[name="payment\\[bank_type\\]"]:checked').val();
            data.additional_data.emi       = $('input[name="payment\\[emi\\]"]:checked').val();
            data.additional_data.email     = this.getEmail();
            console.log($('input[name="payment\\[emi\\]"]:checked').val());
            return data;
        },

        getEmi: function (emiCount) {
            var total = priceUtils.formatPrice(quote.totals().grand_total, quote.getPriceFormat());
            var rowTotal = quote.totals().grand_total;
            var item = '';
            var html = '';
            var i;
            for (i=1; i<=emiCount; i++ ) {
                if (i==1) {
                    item = "
" +
                        "<input type='radio' name='payment[emi_type]' data-bind='event: { change: getData}' id='emi" + i + "' value='" + i + "'>" +
                        "Tek Ödeme, Toplam: "+total+"" +
                        "
";
                } else {
                    rowTotal = parseInt(rowTotal)/i;
                    item = "
" +
                        "<input type='radio' name='payment[emi_type]' data-bind='event: { change: getData}' id='emi" + i + "' value='" + i + "'>" +
                        ""+i+" Taksit, Aylık Taksit: "+priceUtils.formatPrice(rowTotal, quote.getPriceFormat())+" Toplam: "+total+"" +
                        "
";
                }
                html = html+item;
            }

            console.log(html);
            $('.emi-list').html(html);
        },


texts: Adding Message before Magento Payment redirect

texts:
I've developed a new payment module for Magento.It works well but the redirect to the gateway takes about 3o seconds.
I will like to add a message, "please wait while you are redirected to make payment". How can I do that?

The redirect is from the checkout process

Below is my redirect.phtml form

<form name="mygatewayform" method="post" action="https://mygateway.com/Payment.aspx">
<input type="hidden" name="orderid" value="<?php echo $orderId; ?>">
<input type="hidden" name="grandtotal" value="<?php echo $_order->getBaseGrandTotal(); ?>">
    <input type="hidden" name="mercId" value="somenumber" />
<input type="hidden" name="prod" value="Ordered Products" />
<input type="hidden" name="amt" value="<?php echo $_order->getBaseGrandTotal(); ?>" />
<input type="hidden" name="email" value="<?php echo $customer->getEmail(); ?>" />
</form>


texts: Magento 2 : Can not add custom block in admin panel dashboard

texts:
I want to add a custom block to Magento 2 admin panel dashboard.

I have tried the following solution but it's not working.

I am using Magento 2.1.7


texts: How to apply coupon code only to normal price not special price

texts:
I created one shopping cart rule for 10% discount using coupon code tenoff for all products but I want to apply this discount only on products which don't have active special price. Is this possible? how can I achieve this?

I m applying following rule :

If ALL  of these conditions are FALSE :
Special Price  equals or greater than  0.1

But this is working fine for special price which is not expired, now if special price expired then above rule is not working.


texts:
so far we've been working with mostly absolute links which is now causing us an issue because we have 2 different domains for the same language, (.at and .de) and both are sharing the same cms pages categories etc.

But these contain absolute links like: https://myhost.de/contact etc. which obviously are a problem for when used within the .at domain.

How can we address this issue without using relative links which aren't an option because they causing 404 errors.

I guess we could use something like {{base url=''}} or {{store url=''}} inside of cms blocks, but this doesn't seem to work for the url field in categories or for the top menu etc. Maybe I'm just doing something wrong.


texts: Upgrade from 1.7 to 1.9 produces blank Admin Configuration

texts:
I have setup a staging area following the Crucial guide to test upgrading from Magento C.E 1.7 to 1.9, again following guide from Crucial.  The staging area went up after some wrangling.  And the upgrade to C. E 1.9 appears to be working except I am getting blank pages when trying to access System -> Configuration and System -> Permission -> Roles clicking on Administrator.

Tried searching for a solution and these are the things I tried to no avail:

Clearing the cache and /var folder
Removing non Mage modules from app/etc/modules
Clearing cookies on the browser
Tried going to Permission Roles to refresh, but can't even get in.

Any ideas?  Thanks in advance!


texts: Website is not running when point on the server?

texts:
I have setup my website on the server. I configured the database with the website.

When I hit the website URL in the browser, it shows error "page isn't working"

But when I hit the test file from the root, it is working.

What is the issue, could you please help?


texts: PostFactory does not exist in generated Interceptor in magento 2?

texts:
any solution for this bug

 [RuntimeException]
  Class Vendor\Company\Model\PostFactory does not exist in [Vendor\Company\Controller\Index\Index\Interceptor]

block post.php

<?php

namespace Vendor\Company\Block;

use Magento\Framework\View\Element\Template;
use Magento\Backend\Block\Template\Context;

class Campaign extends Template
{
    public function __construct(Context $context,array $data = [])
    {
        parent::__construct($context, $data);
    }
    public function getFormAction()
        {
        return $this->getUrl('vendor/index/submit', ['_secure' => true]);
    }
}

2 model/resourceModel/post.php

<?php

namespace Vendor\Company\Model\ResourceModel;

class Submit extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{

    public function __construct(
        \Magento\Framework\Model\ResourceModel\Db\Context $context
    )
    {
        parent::__construct($context);
    }

    protected function _construct()
    {
        $this->_init('vendor_company', 'campaign_id');
    }

}

Controller post.php

<?php

namespace Vendor\Company\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;

    protected $_postFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory,
        \Vendor\Company\Model\PostFactory $postFactory
        )
    {
        $this->_pageFactory = $pageFactory;
        $this->_postFactory = $postFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
        $post = $this->_postFactory->create();
        $collection = $post->getCollection();
        foreach($collection as $item){
            echo "<pre>";
            print_r($item->getData());
            echo "</pre>";
        }
        exit();
        return $this->_pageFactory->create();
    }
}

Model post.php

<?php

namespace Vendor\Company\Model;

class Submit extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\DataObject\IdentityInterface
{
    const CACHE_TAG = 'vendor_company';

    protected $_cacheTag = 'vendor_company';

    protected $_eventPrefix = 'vendor_company';

    protected function _construct()
    {
        $this->_init('Vendor\Company\Model\ResourceModel\Submit');
    }

    public function getIdentities()
    {
        return [self::CACHE_TAG . '_' . $this->getId()];
    }

    public function getDefaultValues()
    {
        $values = [];

        return $values;
    }
}


texts: How to supplement Google Analytics push data during checkout

texts:
Using Magento CE 1.9.0.1.

We are using Google Analytics to track conversions on our site. We implemented this using the built-in Google API section in the admin panel. It provides enough information including transaction (order) numbers, order amounts, browser data, etc..

I believe this data is submitted upon loading the success page. With that being said, I would like to submit certain data from checkout page - before the order is ever completed. For example, I would like to push the billing address as soon as they fill out the form.

Background: We use an address validation service and sometimes the address that the validation service submits to us isn't correct. It can "over correct" and completely strip vital details from certain addresses. Happens less than 1% of the time but when that is multiplied against 1000 - 2000 orders a day it can really become a problem for our fulfillment department. Yes, we have reported this to the address validation service and they tell us they are investigating it.

I plan to use jQuery to grab the form data in the billing and shipping fields and when the user fills out all necessary fields, do a push to GA.

My question then. If I push custom variables to Google Analytics prior to completing an order, will GA be able to associate that session with my completed transaction?


texts: Mass Action: Bulk invoice - Shipping charges issue

texts:
I have created mass action in order grid to create bulk invoice. And after successfully creating invoice on multiple orders I am facing issue with shipping charges.

i.e, for first order it is adding shipping amount in invoice and for other orders it is excluding shipping amount.

Here is my code for mass invoice:

foreach ($collection->getItems() as $order) {
    if (!$order->getEntityId()) {
        continue;
    }
    $loadedOrder = $model->load($order->getEntityId());

    if ($loadedOrder->canInvoice()) {
        $invoice = $this->_invoiceService->prepareInvoice($loadedOrder);
        if ($loadedOrder->getPayment()->getMethod() != "cashondelivery") {
            $invoice->setRequestedCaptureCase(\Magento\Sales\Model\Order\Invoice::CAPTURE_OFFLINE);
        }
        $invoice->register();
        $invoice->save();
        $transactionSave = $this->_transaction->addObject($invoice)->addObject($invoice->getOrder());
        $transactionSave->save();

//send notification code
        $loadedOrder->addStatusHistoryComment(
            __('Notified customer about invoice #%1. ' . $appendusername, $invoice->getId())
        )->setIsCustomerNotified(false)->save();

        $countInvoiceOrder++;
    } else {
        if (empty($NonInvoiceOrdernuumbers)) {
            $NonInvoiceOrdernuumbers = $NonInvoiceOrdernuumbers . $loadedOrder->getIncrementId();
        } else {
            $NonInvoiceOrdernuumbers = $NonInvoiceOrdernuumbers . ", " . $loadedOrder->getIncrementId();
        }
    }
}


texts: How to add filtering to custom table field column in Customers admin grid in Magento2?

texts:
Added custom columns from custom table to Customers grid using JOIN in the following method:

\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection::_beforeLoad:

protected function _beforeLoad()
{
    ...
    $this->_eventManager->dispatch('core_collection_abstract_load_before', ['collection' => $this]);
    ...
}

and by subscribing to the following event:

core_collection_abstract_load_before

To make custom columns to appear in the Customers grid we are using custom

view/adminhtml/ui_component/customer_listing.xml

file in our module:

<columns name="customer_columns">
    <column name="prxgtDwnlParentId">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">textRange</item>
                <item name="label" xsi:type="string" translate="true">Parent ID</item>
            </item>
        </argument>
    </column>
    <column name="prxgtDwnlCustomerDepth">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">textRange</item>
                <item name="label" xsi:type="string" translate="true">Depth</item>
            </item>
        </argument>
    </column>
</columns>

Everything is working fine, but since we are using aliases for field names filtering is not working.

We came up with the following dirty hack to make it work, basically through reverse transformation "alias" => "table.field":

public function execute(\Magento\Framework\Event\Observer $observer)
{
    ...
    /* the dirty hack */
    $where = $query->getPart('where');
    $replaced = $this->_replaceAllAliasesInWhere($where);
    $query->setPart('where', $replaced);
    ...
}

protected function _replaceAllAliasesInWhere($where)
{
    $result = [];
    foreach ($where as $item) {
        $item = $this->_replaceAliaseInWhere($item, self::AS_FLD_CUSTOMER_DEPTH, self::AS_TBL_CUST, 'depth');
        $item = $this->_replaceAliaseInWhere($item, self::AS_FLD_PARENT_ID, self::AS_TBL_CUST, 'parent_id');
        $result[] = $item;
    }
    return $result;
}

protected function _replaceAliaseInWhere($where, $fieldAlias, $tableAlias, $fieldName)
{
    $search = "`$fieldAlias`";
    $replace = "`$tableAlias`.`$fieldName`";
    $result = str_replace($search, $replace, $where);
    return $result;
}

There should be much more elegant way of doing it. Please, advise.


texts: How to get Shopping Cart Discounts in Magento?

texts:
Having multiple promotions (or discounts) applied for shopping carts, how to get such promotions so I can display them in view?

Update:
I want to get each. NOT the total. This is so I can display the labels of each promotions/discounts for the cart. Such as:

Sub Total: 100.00
Discounts:
   First Purchase: -10 (10%),
   Employee Discount: 5 (5%)
Shipping Fee: 20.00
Grand Total: 105


texts: Magento and exif photo automatic rotation. How to prevent or fix?

texts: i'm on Magento CE 1.9 and i have some problems with image uploading. I discovered that the problem is with the exif. That tag isnt work good. On my shared server i cant install php plugins etc.. do you know some kind of plugin or code to fix that? I can fix it with php only but i cant figure out how to integrate it into Magento. Really i think it's may be an really common problem. So if you help me you will help others... if you can, Thanks.


texts: I tried to enable 3D secure in BrainTree Credit card payment method in Magento 2.3.4 and it shows the error "Please try another form of payment option". I checked the logs and not found any issues. The 3DS working with sandbox and without 3DS production mode of payment working. The issue only with the 3DS and production mode. Any idea about the issue?


texts: How to remove the  tags in CMS pages using {{block type="core/template" template="file.phtml"}}

texts:
In Magento 1.9, I am creating CMS pages. I have a CMS page that fires an external template:

{{block type="core/template" template="/modules/storelocator/storelocator.phtml"}}

However, this page has this code

Hello World

When Magento is accessed this page, it fires and nests  tags inside everything. Can this be removed?


texts: Magento2: Gift Option form custom field not saved

texts: I have created some custom fields for Gift Option Form and i have created extension_attributes.xml file as well but the custom field is not getting saved.


texts:
I am right now researching on tracking order status of a product through FedEx.
I have a tracking number from fedEx with me of a real ordered item by a customer (taken from main site). I added that tracking number to my dummy ordered item after shipping in  my localhost.
I am getting the following error whenever I try to track a order from admin panel or from frontend as a logged in customer:

I think this is because of no fedex credentials inputted in admin panel. But I don't know where to add these fedex authentication credentials.
I tried adding the test credentials provided by fedEx in System -> Configuration -> SALES: Shipping methods -> Fedex but it seems no use. Still I get the same above error. (FedEx also provided a test server, which is webservice, I don't know where to enter this.)
Is it because I am testing it from localhost instead of main site? I can't test on main site due to other problems.
and also please give your valuable suggestions related to this topic.
Thanks.


texts:
I just installed magento2 website, what I want to do is to add "About Us" footer link into the default footer links, from search, what I can achieve is to
1) Create a block
2) Create a widget, then set the widget for all pages, for the footer links
Below is what I have completed, but I want to insert the "About Us" directly below the default "Contact Us", is that possible for magento 2?

And I am still not know how magento2 generates the default footer links, I cannot figure out from the theme default.xml (/var/www/html/vendor/magento/module-theme/view/frontend/layout)

     <referenceContainer name="footer-container">
        <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content">
            <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/>
            <block class="Magento\Framework\View\Element\Html\Links" name="footer_links">
                <arguments>
                    <argument name="css_class" xsi:type="string">footer links</argument>
                </arguments>
            </block>
            <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/>
            <block class="Magento\Framework\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" />
        </container>
    </referenceContainer>

Does anybody have insight? Thanks.


texts:
I want to send a "set password" email to users.

I made a script where there is an option like "user register by email id" and other details. We review their detail and activate them. When the user is activated, a mail is sent to them to set the password for their account.

I'm stuck with part of sending set password email.


texts: Magento import a foreign key constraint fails

texts:
I am trying to import(with bigdump) my live database to an test database. While importing the tables to the test database im getting the following error.

MySQL: Cannot add or update a child row: a foreign key constraint fails (DB_Name.catalog_product_entity, CONSTRAINT FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID FOREIGN KEY (attribute_set_id) REFERENCES eav_attribute_set (attribute_set_id) ON )

I have set the SET Foreign_Key_Checks but it seems this isn't changing the error at all.

SET FOREIGN_KEY_CHECKS = 0;
//Code
SET FOREIGN_KEY_CHECKS = 1;

Do I need to change table names? What am I doing wrong?


texts:
My styles are not working with bin/magento setup:static-content:deploy.
It is working only after running grunt commands.
Due to this my code is not working in server.
we are using Magento 2.3.5-p2.


texts: Magento - 1 x SKU covering multiple SKU's - How to?

texts:
I'm struggling a bit on how to sell a product that is sold individually, but also in a package including more products. Let me illustrate it as a real example:

Sample pack e-liquid (including 1x orange, 1x strawberry, 1x apple)

Customer can choose: strength: 0, 6, 12, 18, 24 (meaning that each flavor has 5 SKU's)

I can't figure out how to make this right - the problem is that the inventory should adjust itself accordingly whether the customer buys a product alone or in combination with other products (as in the case illustrated above - the Sample Pack)

Lets say we sell Orange with SKU: N1 individually it will automatically reduce the stock-level - no problem. BUT this should also happen when the same product is sold in a Sample pack. How can this be done right?

Hope anyone can help! I really tried to study several tutorials, but can't find any example helping me solve this problem.

If my explanation is not clear enough, please fire me additional questions. Thanks!

PS. If you want to see a real example, please check this link: http://din-ecigaret.dk/lille-rygestopspakke

This is a starterkit including including 3 different liquids (that customer can choose) The strength is predefined (16mg) as we at this given time, we can not mess up our inventory control by letting customers chose between several strengths - but it would be very convenient if for the customer if this could be possible. Again, that refers back to the question I'm asking - how can we do this right without messing up our inventory completely?


texts: magento2 search_tmp join leads to empty results in category listing

texts:
I just imported products into fresh magento2 instance and encountered issue that category product listing block are empty, although the products successfully appear in database . I have debugged list.phtml block and dumped the collection query which is:

SELECT `e`.*,
           `cat_index`.`position` AS `cat_index_position`,
           `price_index`.`price`,
           `price_index`.`tax_class_id`,
           `price_index`.`final_price`,
           IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`,
           `price_index`.`min_price`,
           `price_index`.`max_price`,
           `price_index`.`tier_price`
    FROM `catalog_product_entity` AS `e`
    INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id
    AND cat_index.store_id=1
    AND cat_index.visibility IN(2,
                                4)
    AND cat_index.category_id='31'
    INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id
    AND stock_status_index.website_id = '1'
    AND stock_status_index.stock_id = 1
    INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id
    AND price_index.website_id = '1'
    AND price_index.customer_group_id = 0
    INNER JOIN `search_tmp_58171902857f18_28938044` AS `search_result` ON e.entity_id = search_result.entity_id
    WHERE (stock_status_index.stock_status=1)
    ORDER BY `cat_index`.`position` ASC LIMIT 9

I tried to run this raw query in in console mysql and noticed that it fails on this part:

INNER JOIN `search_tmp_58171902857f18_28938044` AS `search_result` ON e.entity_id = search_result.entity_id

which is probably virtual table

without this JOIN query returns collections as expected

any suggestions for directions of debugging would be much appreciated

PS
cache is turned off, and I have rebuilt indexes via bin/magento indexer:reindex,
the theme is porto


texts: Create configurable product using multiple bundle products

texts:
Lot of time, people have inquired about creating bundle product from multiple configurable products. Even extensions are available for the same.

But my requirement is different.
I require to attach payment frequency (recurring profile) attribute to bundle product, and based on that require to generate configurable product.

I am not getting enough pointers for the same.

So basically, what I need is:
When I create configurable product, I should be able to select bundle products, along with simple products.

Any pointers would be helpful.

If ready-made such solution is not available, please suggest what things I should be take care of.


texts: Magento2.3: How to set the border bottom for whole header?

texts:
I have a megamenu in header and want to set the border bottom for the whole header and it should be aligned with the megamenu border but its not working as expected.

I have tried that into the following path:

  vendor/magento/module-theme/view/frontend/templates/html/header.phtml

My requirement is to put the grey border to whole header and the border should be the same alignment with the border given in megamenu.

Any help will be appreciated!


texts:
I have installed the Amasty ShopBy Extension and am trying to make my own modifications the correct way: using my own extension.

I have created a preference in di.xml (tried in /etc and /etc/frontend) as follows:

<preference for="Amasty\ShopbyBrand\Block\Widget\BrandList" type="Wildcard\AmastyShopbyExtension\Block\Widget\BrandList" />

And the widget block file:

<?php

namespace Wildcard\AmastyShopbyExtension\Block\Widget;

use Amasty\ShopbyBrand\Block\Widget\BrandList as AmastyBrandList;

class BrandList extends AmastyBrandList
{

}

With the above in place, the widget does not show anything at all. However, if I place a die('here'); right before the class declaration, the word 'here' is printed. This tells me that the preference is working as it should.

Surely if I have an empty class and am extending from another, the properties and methods from the other class would all still be in tact and apply?

Also, if I add the following in my class:

protected function _beforeToHtml()
{
    echo "This works";

    return parent::_beforeToHtml();
}

The 'This works' string is echoed to screen.

Is there anything I am missing?

Using Magento 2.1.7


texts: How to load multiselect attribute values for current product

texts:
I have problem when I try to load multiselect values for product. I have:

$product->getSportTypes()

But these can give me only "sport type" Ids, not and names. How to get names?


texts: Creating custom sql code to update qty of a certain attribute not found in csv file during import

texts:
Im currently working on a sql formula that when i import a particular supplier and products are removed from the file to only update the qty of those in the database to 0. But what happens is that it updates every other supplier as well. Here is the formula below. We have created an attribute in magento called supplier. So how can we add this in the formula to only update products not on file that are "supplier A" as 0 only? Thanks

 /* This SQL block may be executed after product import and it will set products that are not in imported file as "Qty 0". */
/* Please note that this SQL block must be modified manually according to your database specifics to work properly.              */

UPDATE /*PREFIX*/cataloginventory_stock_item SET qty = 0
  WHERE product_id in (&`prod.ProdNotInCsv`);/*DELIMITER*/

UPDATE /*PREFIX*/cataloginventory_stock_status SET stock_status = 0
  WHERE product_id in (&`prod.ProdNotInCsv`);/*DELIMITER*/


texts:
Where can I find HTML to add role="alert" to error messages in magento. For example, when a user provides a wrong zip code on checkout page this error message shows up.

Please enter a valid zip code (Ex: 90602 or 90602-1234).

I would like to add an attribute to the above div tag. Magento version is 2.x.


texts: Error on backup utility in Magento2 admin

texts:
When I try to do a back up in admin using the utility it gives me the following error

Failed to save backup with error: Utility gzip not found

I have confirmed the gzip is loaded on the server (And I tested it)

Magento EE 2.0.7

Per Steve's instructions I did the following

php bin/magento support:utility:check -u
Utilities list:
gzip => /bin/gzip
lsof => /usr/sbin/lsof
mysqldump => /usr/bin/mysqldump
nice => /bin/nice
php => /usr/bin/php
tar => /bin/tar
sed => /bin/sed
bash => /bin/bash
mysql => /usr/bin/mysql


texts:
I get the following error in my shop, after it had worked normally:

  Fatal error: Class 'Varien_Cache_Core' not found in /public_html/lib/Zend/Cache.php on line 195

It breaks the entire website, and I have no idea why, as it happened without any lead.

All folders have been given 777 permission, to make sure that wasn't the problem.

Any idea where I should look for this?


texts: Adding Custom Date Range on Admin Dashboard Chart Magento

texts:
I am working on a task to show Date Range on Dashboard chart. so data chart will display on custom date range selection. I have added calendar on chart but result is not coming properly. I know its very specific requirement. I am looking if someone has already done such modification and can provide me some guidence to achieve this.

I have added calendar from the following code in adminhtml/default/default/template/dashboard/graph.phtml:

    <?php echo Mage::helper('contacts')->__('Start Date') ?>

        <input name="startdate" id="startdate" value="" type="text">
        <img title="Select date" id="startdate_trig" src="<?php echo 'http://192.168.0.32/pankgento/skin/adminhtml/default/default/images/grid-cal.gif'; ?>" class="v-middle">

    <?php echo Mage::helper('contacts')->__('End Date') ?>

        <input name="enddate" id="enddate" value="" type="text">
        <img title="Select date" id="enddate_trig" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'/adminhtml/default/default/images/grid-cal.gif'; ?>" class="v-middle">

        <input type="button" name="btn" value="Search" onchange="changeDiagramsPeriod();" />

Already a function changeDiagramsPeriod created in adminhtml/default/default/template/dashboard/index.phtml. It is responsible for making the ajax request, its creating ajax request for every dynamic block.


texts: Please Help me on this topic I want to add description for shipping methods. For example, If Flat Rate shipping method is on, than there is a text box for add description in admin side, add content in this textbox and showing that text in frontend . Same as all shipping method from admin and that label will be display on front-end. Please give me a way to make easy.


texts: Footer is missing in magento checkout page-magento2

texts: How to add footer in magento2 checkout page.it's missing


texts:
Need help trying to remove a array value (Customer ID) from a attribute array value in a collection

 //unfollowAction
 //Get Model to save data to.
 $model = Mage::getModel("userprofiles/userprofiles");
 $model->getCollection()->addFieldToFilter('userprofiles_id', $id);
 $model->setUserprofilesId($id);

 //Get Model to fetch data from
 $model2 = Mage::getModel("userprofiles/userprofiles")->load($id);

 //Build Array output is 123,234,345,456,
 $FollowProfilesArray = array($model2->getFollowProfiles());

 //Remove specified ID from array, $profile_id equals current customer ID
 $remove_from_array = array_diff($FollowProfilesArray, array($profile_id,));

  foreach($remove_from_array as $key => $value){
  $select .= ''.$value.',';
  }

   //save new array to attribute value with the specified ID removed.
   $model->setFollowProfiles($select);

Problem is that this code is not removing the specified ID and saving the attribute value as 123,234,345,,

Note:

$model2->getFollowProfiles() output/saved value is 123,234,345,456 etc

the code $FollowProfilesArray = array($model2->getFollowProfiles()); does not work as stated above but if it hardcode the array data to

//Works,but not ideal or relevant
$FollowProfilesArray = array(123,234,345,456,);

So is there something im missing like exploding or imploding the $FollowProfilesArray = array($model2->getFollowProfiles()); code


texts: Magento 2: create a coupon code using events and observers

texts:
I need to create a coupon code for different customers based on their country.

For example: If the customer is from US, the discount should be 10% and if it is UK, it should be 20%. This I have to create using events and observers. How can I do this?


texts: What tables are updated when a new product return is made?

texts: I need to know because when a customer is requesting a product return on the frontend there are no notification that shows up and let our employee know that a new product return has been created.


texts: Creating new order states programmatically in Magento2

texts:
I'm stuck on trying to create a new order state programmatically.
So far I'm only able to read the currently available states from

\Magento\Sales\Model\Config\Source\Order\Status

I am unable to find a model I can fill let alone some kind of interface, api or Manager for order states.

In magento 1.9 this was done using the following code:

model = Mage::getModel('sales/order_status')->load('error');
$model->setStatus('error');
$model->setLabel('Not Sent To XXX');
$model->save();
$model->assignState(Mage_Sales_Model_Order::STATE_HOLDED, false);


texts: How do I load an Order by Id and include all attributes?

texts:
I have a simple case where I need to load an order by an ID and include all it's attributes.

So far I can load the order by id, but can't find out how to include all attributes:

Mage::getModel('sales/order')->load(123);

Or I can load the collection with all attributes, but can't figure out how to filter by id:

Mage::getModel('sales/order')->getCollection()->addAttributesToSelect(*);


texts:
My checkout first step have an infinite loop.

Console log give me only a warning

jQuery.browser is deprecated

Magento log

main.CRITICAL: Unable to resolve the source file for 'frontend/Altravista/bookshop/en_US/css/bootstrap/bootstrap.min.css.map'

can be this the problem?

No server logs

No networks errors

How can i debug? I'm going crazy


texts: Customizable options not showing in cart or order

texts:
Magento 2.2.2, when an item is added to the cart, any customizable options selected when adding a product to the cart are not displayed in the cart or order.

In testing, I have found that the Sku that is passed to CheckoutCartProdtuctAdd does not contain the part of the SKU specified in the customizable option.

I have a backup from a month ago that does pass the Sku correctly, I have compared files and tested and found that the problem is caused by an entry in the database i.e. if I get the working backup and run it up with its database it works, but if I run it with a copy of the database from the current non-working site the problem is there.

I am sorry I cannot give steps to recreate as I don't know when this happened or what caused it.

Any help deeply appreciated as I am tearing my hair out!

Many thanks
John


texts: Link Product A and Product B to the same product with unique SKU and discret stock

texts:
like my Title says we want to link a product A and B to the same product.

At this point, we aren't using at our Magento 2 shop a Configurable Product to select a specified product only to create Products.

At the ebay-side, we want to use a Configurable Product with only 2 Dropdowns which choosing implies the other attributes.

We want to keep stock so using 2 different articles wouldn't be great because of the overhead.


texts:
I'm using magento 2.1.
I would like to make the customer select his customer group while ordering process.

But being a guest and doing an order when he is in checkout and types in his data, the customer group drop down ( I've added ) displays the "NOT LOGGED IN" value also - as the guest user is not logged in.
How can I make this value not shown for all front end forms?
For a customer who wants to create an account it looks fine, the drop down is not showing the "NOT LOGGED IN" value.
I'm talking about data for my drop down which is taken from "customer_group" table in database.


texts:
When attempting to add images programmatically to a Magento cloud instance we are getting the following error:

Warning: mkdir(): Read-only file system

We did find the following post, but the reply says we need to checkout the instance using GIT, copy the files locally and then redeploy. There must be a better way?

Upload optimized images to magento cloud server


texts:
I am currently creating a button for a single order in Magento(next to invoice, ship, reorder etc.). I would like the button to link to a javascript function inside a template with variables from that order passed to the function.

The way I currently have is I call a custom controller which goes to a new        page("setLocation('{$block->getUrl('*/shiprush_orderbutton/indexaction')}')").

Is there any way I could avoid this and just call the function straight on the click of the button.

app\code\local\MyApp\OrderButton\etc\config.xml

<config>
<modules>
    <MyApp_OrderButton>
        <version>0.0.1</version>
    </MyApp_OrderButton>
</modules>
<global>
    <models>
        <myapp_orderbutton>
            <class>MyApp_OrderButton_Model</class>
        </myapp_orderbutton>
    </models>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <myapp_orderbutton before="Mage_Adminhtml">
                        MyApp_OrderButton_Adminhtml
                        </myapp_orderbutton>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</global>
<adminhtml>
    <events>
        <adminhtml_widget_container_html_before>
            <observers>
                <myapp_orderbutton>
                    <class>myapp_orderbutton/observer</class>
                    <method>adminhtmlWidgetContainerHtmlBefore</method>
                    <type>singleton</type>
                </myapp_orderbutton>
            </observers>
        </adminhtml_widget_container_html_before>
    </events>
    <layout>
        <updates>
            <orderbutton>
                <file>mybutton.xml</file>
            </orderbutton>
        </updates>
    </layout>
</adminhtml>
</config>

app\design\adminhtml\default\default\layout\mybutton.xml

<layout>
    <adminhtml_sales_order_view>
        <reference name="head">
            <action method="setTemplate><template>shiprush/sales/order/view/info.phtml</template>
            </action>
        </reference>
    </adminhtml_sales_order_view>

app\code\local\MyApp\OrderButton\Model\Observer.php:

class MyApp_OrderButton_Model_Observer {
public function adminhtmlWidgetContainerHtmlBefore($event) {

    $block = $event->getBlock();
    $magemodel = Mage::getModel('sales/order');
    $orderid = $magemodel->getIncrementId();
    $order = $magemodel->loadByIncrementId($orderid);
    if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
        // $block->prepareLayout();
        $block->addButton('do_something_crazy', array(
            'label'     => 'my button',
            'onclick'   => "setLocation('{$block->getUrl('*/myapp_orderbutton/indexaction')}')",
            'class'     => 'go'
        ));
    }
}
}

app\code\local\MyApp\OrderButton\controllers\Adminhtml\ButtonController.php:

class MyApp_OrderButton_Adminhtml_ButtonController extends Mage_Adminhtml_Controller_Action {
public function indexAction()
{
    $this->loadLayout();
    $this->renderLayout();
}
}


texts: Magento White Screen FrontEnd - PHP Startup: Unable to load dynamic library

texts:
I was recently trying to add a javascript gallery to my development magento site and was editing code through the "page.xml" - it wasn't working so i deleted the code out of the file.

Now when i load the website it comes up with the White Screen - so googling around i did the necessary steps

uncomment the ini_set('display_errors', 1);"
added the "ini_set('memory_limit', '256M');

AND i could not get the error to show up... so i added the code at the bottom of this webpage (https://stackoverflow.com/questions/19222103/magento-white-screen-on-admin-log-in-page)

Now it shows an PHP Load Error:

Array
(
    [type] => 32
    [message] => PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so: cannot open shared object file: No such file or directory
    [file] => Unknown
    [line] => 0
)

Could anyone point me in the right direction of what the issue could be and a possible solution??

Anything would be greatly appreciated


texts: disable "Add to Cart" when special price date ended

texts:
I am beginner to magento and want to disable "Add to cart" button when special price to date is ended, is there a way to do that?
thanks.


texts: Magento 2 - How to retrieve the name and quantity for each product ordered in success.phtml file

texts:
I need to add an iframe for tracking the orders, and the code needs some values like Subtotal, order id, name of every product in the order and also the quantity for each product.

I found a solution for order id and subtotal value.

<?php
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$orderData = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($block->getOrderId());
$transaction_id = $orderData->getData()['increment_id'];
$amount = number_format($orderData->getData()['subtotal'],2);
?>

From  getData() function you can retrieve informations like, subtotal, customer email, order id, status of the order, store id, shipping description, etc.

But nothing about the products, like name, sku, quantity, description etc.

How can I retrieve this information, the list of all products name and quantity of each product?


texts: How to override vendor/magento/module-import-export/Files/Sample?

texts:
I tried,

 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\ImportExport\Files\Sample">
    <plugin name="change_product" type="\Test\Abc\Files\Sample" />
</type>
 </config>

Created folder Test/Abc/Files/Sample - In that i have uploaded file.

But its not overriding?


texts:
I'd like to show the product thumbnail in the new orders emails.
I tried this code:

<img src="<?php echo Mage:: getThumbnail('catalog/product_media_config')
             ->getMediaUrl($_product->getThumbnail()); ?>" alt="<?php echo $_item->getName() ?>" />

It doesn't work. Any helps?


texts: How to add data in sales order table after place order?

texts:
In sales_flat_order i m adding custom column. Now when i place order that time i want to save data in custom column

I m trying this code:

config.xml

<global>
    <events>
         <checkout_onepage_controller_success_action>
            <observers>
                <price_observer>
                    <type>singleton</type>
                    <class>Company_Example_Model_Observer</class>
                    <method>setIdInOrder</method>
                </price_observer>
            </observers>
        </checkout_onepage_controller_success_action>
    </events>
<global>

observer.php

public function setIdInOrder($observer) {
    $event = $observer->getEvent();
    $orderId = $observer->getEvent()->getOrderId();
    $id = Mage::getSingleton('core/session')->getStudentId();
    $order = Mage::getModel('sales/order')->load($orderId);
    $order->setData('student_id',$id);
    $order->save();
    Mage::getSingleton('core/session')->unsStudentId();
}

set session like this

$id = 1;
Mage::getSingleton('core/session')->setStudentId($id);

Now i m getting this error

  Fatal error: Call to a member function getMethodInstance() on a non-object in F:\wamp\www\tution\app\code\core\Mage\Payment\Model\Observer.php on line 46

I can't get it where i m wrong. After Add this event this error occured. How to fixed this error


texts:
while selecting the products from flat table. out of stock products are missing.

Is there any configurations that will populate the out of products also in flat table?

Where the flat tables can be used in Magento?


texts: products disappear from category page or search result, index error cluster_block_exception

texts:
Products sometimes disappear from the category pages in the frontend. It might be after reindex, or clear cache. If i go to magento admin panel->catalog-> and highlight the category, make some changes, then"save". It sometimes bring back the products into the category.

what might be the cause to the issue? i'm thinking some permission not set correctly?

UPDATED:
seems like making some changes in the category (for example, edit product positions), then clear clean sometimes bring back the product, but it is gone again after awhile (when reindex runs?)

magento version: 2.2.6

products are migrated using data-migration-tool from magento 1.9.2

sometimes when i reindex, this error occurs, but 90% it return success message.

Catalog Search indexer process unknown error:
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}


texts:
I would like the wrap my second and third level categories in my main menu in a div tag so i can make a mega menu using the div to position the links.

Is this possible. Heres an example of what i mean:

    1st level

2nd level

3rd level

3rd level

3rd level

2nd level

3rd level

3rd level

3rd level

1st level

1st level

1st level

1st level

Something along those lines is what im looking to do. Any help would be great, thanks


texts: Can we modify xsd file of magento core modules or use custom xsd instead of their xsd files?

texts:
I need to modify the email_templates.xsd file of Magento_Email module.

So can I modify it, if yes then how and if not then can I use custom file instead of original .xsd file.I tried using my custom .xsd file but it's not working.

Any help would be appreciated.


texts: How do I send Order Confirmation Email after successfull Payment in Magento 2.3.0

texts:
I am struggling with this from past 3 weeks and tried almost all of the solutions suggested but nothing works for me. I want to send an Order Confirmation email after successful payment (Payment Gateway Paystack).

Even I have tried this https://meetanshi.com/blog/send-magento-2-order-confirmation-email-after-payment-success/ but the mails stop working for an order previously emails were sent with payment now they are not. Please help how can I fix this in Magento 2.3.0.

Environment Using -

Magento 2.3.0
PHP 7.1
CentOS 7 Godaddy server


texts: Why this complex logic for cookie domain in session start?

texts:
I was debugging why an empty value in the cookie domain still resulted in a domain value being set in the session cookie and came across this weird code in Mage_Core_Model_Session_Abstract_Varien:

    // session cookie params
    $cookieParams = array(
        'lifetime' => $cookie->getLifetime(),
        'path'     => $cookie->getPath(),
        'domain'   => $cookie->getConfigDomain(),
        'secure'   => $cookie->isSecure(),
        'httponly' => $cookie->getHttponly()
    );

    if (!$cookieParams['httponly']) {
        unset($cookieParams['httponly']);
        if (!$cookieParams['secure']) {
            unset($cookieParams['secure']);
            if (!$cookieParams['domain']) {
                unset($cookieParams['domain']);
            }
        }
    }

    if (isset($cookieParams['domain'])) {
        $cookieParams['domain'] = $cookie->getDomain();
    }

So, the logic is this:

$cookie->getConfigDomain() returns the domain configured for the store verbatim. This can be empty.
and this is the weird part:

if httponly is not set
if secure is not set
only then we unset the domain key in cookieParams

if the domain key is NOT unset, we fill the domain with the HTTP Host.

I don't understand the rationale for the nesting of those 3 if statements. Is it known and am I missing a standard or is it a bug?

Reason I ask is that in recent cookie standards simply setting the domain value of the cookie, implies you set it for the domain and it's direct subdomains.

Only if you do not set a domain attribute on the cookie, the host only rule applies. Apparently you can prepend a dot for compatibility with the original RFC 2109 implementation, but it's optional.

Ref: http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Path


texts:
I'm using magento 1.9 version.
I'm trying to add a image field in magento customer product review page. It gets submitted and saved in DB. When trying to approve the review, the custom field was not saved again(ie., is saves as empty).
How to save the field again with same data saved while submitted.


texts: Apache SetEnfIf and fullpage cache: Start page shows the same store view for all URLs, once cached

texts:
We have a setup with a public facing NGINX reverse proxy that sets the head X-Magento-Store and the shop instance on an apache Vhost

in apache I added

    SetEnv MAGE_RUN_TYPE "store"

    SetEnvIfNoCase X-Magento-Store ^english$ MAGE_RUN_CODE=english
    SetEnvIfNoCase X-Magento-Store ^italian$  MAGE_RUN_CODE=italian

And every thing works fine as long as full_page cache is off.

If full_page cache is on, and I open the Italian URL www.example.com/it-it/shop first, the Italian start page is also shown when opening www.example.com/en_gb/shop and vice versa.

So it seems to me that the store code is missing in the full_page cache key some how, but why?

Steps to reproduce, without proxy setup:

1) In pub/.htaccess set

SetEnv MAGE_RUN_TYPE store
   SetEnv MAGE_RUN_CODE italy

2) Now open Frontend

3) Now set

SetEnv MAGE_RUN_TYPE store
   SetEnv MAGE_RUN_CODE english

4) Now Open frontend, same URL

-> Italian version is displayed

Debugging

Setting break point in \Magento\Framework\App\PageCache\Kernel::load


texts: Can't upload any files to the admin dashboard?

texts:
for some reason I can't seem to save extension configuration with files attached.

I'm attempting to update the logo for our PDF extension, when I browse for the file and save it confirms it was saved successfully but it hasn't

I've also just purchased Webshopapps premium matrix rates and I've tried to attach the CSV and save and it did the same thing... any ideas?

I assumed it was down to permissions and attempted to fix them via SSH with no luck

Regards


texts: Uncaught TypeError: element.attachEvent is not a function

texts: I'm getting an error on the checkout onepage, can you help me what cause of this error.


texts: How to set a value as selected in custom admin form?

texts:
I have an admin form with following field

$author = Mage::helper('blog/post')->getDefaultAuthorId();

    $fieldset->addField('post_author', 'select', array(
        'label' => Mage::helper('sprung_blog')->__('Author'),
        'name'  => 'post_author',
        'required'  => true,
        'class' => 'required-entry',
        'value' => $author,
        'values'=> Mage::getModel('sprung_blog/post_attribute_source_postauthor')->getAllOptions(true),
    ));

Postauthor.php file contains following

public function getAllOptions($withEmpty = true, $defaultValues = false){

$collection = Mage::getModel('blog/author')->getCollection();

$options = array(array('value'=>'', 'label'=>'Please Select Author'));

foreach ($collection as $cat){

    $options[] = array('value'=>$cat['entity_id'],'label'=>$cat['author_name']);
}
return $options;

}

Here, I have one author as selected default from admin configuration. So when i add a new post , "post_author" field i need to display the default user id as selected. After setting 'value' also its not showing as selected in admin form.Please help


texts: custom attribute value in not saving in quote

texts:
I am trying to save custom attribute Value In quote table But code is not working in am adding below code in my controller

$quote = Mage::getSingleton('checkout/session')->getQuote();
        $quote->setCustomAttribute('test')->save();
        $quote->save();

please help me to understand what i am doing wrong


texts: How to add field value while creating a simple product Programmatically in Magento 2?

texts:
I have successfully created simple product Programmatically using magento 2.
But i have created a filed in back end and add that in product but how to fill that data when creating a product.

I have created my product by
$product = $this->productFactory->create();
                $product->setSku($productsku);
                $product->setName($productname);
                $product->setDescription($productname."Description3");
                $product->setShortDescription($productname."Short Description3");
                $product->setWebsiteIds([1]);
                $categories = ["3"];
                $product->setCategoryIds($categories);
                $product->setWeight(1);
                $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE);
                $product->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH); // To make product visible in both catalog,search
                $product->setPrice($p);
                $product->setAttributeSetId(4); // Attribute set for products
                $product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
                $product->setUrlKey($productsku);
                $product->setStockData(
                    array(
                        'use_config_manage_stock' => 0,
                        'manage_stock' => 1,
                        'is_in_stock' => 1,
                        'qty' => 1
                    )
                );
                $product = $this->productRepository->save($product);
                $product->save();

Like i have to add some custom data while creating a product Programmatically.How to do that ?
Any Help is appreciated.


texts:
My Magento website can't load CSS and Js and it is shown in the form of the attached image.

Link to the website: http://www.goharshad.af/

Any help will be highly appreciated on this problem.

Thanks.


texts: Clean certain entries in DB through collection

texts:
I searched for a way to clean rows in DB, where something, through a resource collection call, but could not find relevant information.

I.e., I have table with fields store_id , path , value and 400 rows and I want to clean the rows where the store_id is 1 (or something else). My question is - is this possible through a collection call, or with the resource model?

The table is custom, and I have resource model for it.


texts: Magento 1.9 custom multiselect field renderer - how to?

texts:
In my customization I need a multiselect field in form so I added new field and created a renderer hoping it will work and I've done it this way:

... form.php

   $fieldset->addField('test', 'multiselect', array(
        'name'      => 'test',
        'label'     => Mage::helper('cms')->__('Test'),
        'title'     => Mage::helper('cms')->__('Test'),
        //'onchange'    => "alert('onchange')",
        'class'     => 'sortable',

        'values'    => new Mage_Adminhtml_Block_Cms_Block_Renderer_Test(),
    ));

and so far .... it works, then my renderer

class Mage_Adminhtml_Block_Cms_Block_Renderer_Test
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {

public function render() {
    // getting banners data filtering by "is_slider = true"
    $myBanners = Mage::getModel( 'cms/block' )->getCollection()
      ->addFieldToSelect('identifier')
      ->addFieldToFilter( 'is_slider', true )
      ;

    foreach($myBanners as $banner){
        $output[] = array(
            'value' => $banner->getData('entity_id'),
            'label' => $banner->getData('identifier'),
            );

    }

    return $output;

}

}

Is my approach correct ?
Of course it does not work yet, at least I can't see any positive results except a multiselect grid/table with around 7 selected "empty lines"
How should I do it ?

In effect of this I'm getting:

    Test

    <select id="block_bannerIds" name="test[]" title="Test" class="sortable select multiselect" size="10" multiple="multiple">
<option value="" selected="selected"></option>
<option value="" selected="selected"></option>
<option value="" selected="selected"></option>
<option value="" selected="selected"></option>
<option value="" selected="selected"></option>
<option value="" selected="selected"></option>
<option value="" selected="selected"></option>
    </select>


texts:
I've got the following situation on my website:

1 - I search my products based on simple ones (which is alright);
2 - When I click on them my Product page shows me the configurable one (which is alright);
3 - The problem:

When I add one product in my cart and go to the CART page, it is showing the configurable product, which is not the correct.

I'd like to be able to show the chosen simple product instead. Any ideas?

Thanks in advance.


texts:
I have a problem trying to find the template that shows recently viewed products  I have a theme installed anyway but I can't find it to modify its appearance. I need your help.

Please Regards


texts:
I am using an extension that allows me to add customer attributes to the registration page. Now I want to add the value that the customer fills in as a variable in the email. How do I find out the code to call the variable?

Any hint would be appreciated.


texts: Using another controller's action within a custom module's controller

texts:
I have successfully created an extension that adds all Magento's default contact inquiry submissions into a database. It works great.

I have added an option under the 'Customers' menu that uses Magento's grid to add the contact form submissions into grid.

I am able to mass select the captured data for the purpose of deleting.

I have also added a "Resend" option to the actions and am able to execute:

    public function massResendAction() {
          $post = $this->getRequest()->getPost();
          Zend_Debug::dump($post);
          die('here');
      }

I have added a new action called "Mass Resend":

array(3) {
  ["form_key"] => string(16) "Be8rJzWBona0R2Ij"
  ["enhancedform_id"] => array(2) {
    [0] => string(2) "12"
    [1] => string(2) "13"
  }
  ["massaction_prepare_key"] => string(15) "enhancedform_id"
}

here

What I would like to do is use Magento's built in Contacts form post action:
app/code/core/Mage/Contacts/controllers/IndexController.php

public function postAction()
{
    $post = $this->getRequest()->getPost();
    if ( $post ) {
        $translate = Mage::getSingleton('core/translate');
        /* @var $translate Mage_Core_Model_Translate */
        $translate->setTranslateInline(false);
        try {
            $postObject = new Varien_Object();
            $postObject->setData($post);

            $error = false;

            if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {
                $error = true;
            }

            if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {
                $error = true;
            }

            if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
                $error = true;
            }

            if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
                $error = true;
            }

            if ($error) {
                throw new Exception();
            }
            $mailTemplate = Mage::getModel('core/email_template');
            /* @var $mailTemplate Mage_Core_Model_Email_Template */
            $mailTemplate->setDesignConfig(array('area' => 'frontend'))
                ->setReplyTo($post['email'])
                ->sendTransactional(
                    Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
                    Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
                    Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
                    null,
                    array('data' => $postObject)
                );

            if (!$mailTemplate->getSentSuccess()) {
                throw new Exception();
            }

            $translate->setTranslateInline(true);

            Mage::getSingleton('customer/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
            $this->_redirect('*/*/');

            return;
        } catch (Exception $e) {
            $translate->setTranslateInline(true);

            Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
            $this->_redirect('*/*/');
            return;
        }

    } else {
        $this->_redirect('*/*/');
    }
}

Instead of duplicating this code.