texts: Totals showing wrong value when updating totals section in cart page via ajax magento 1.9

texts:
I have created a country dropdown on cart page with the following code.

    *<?php echo $this->__('Country') ?>

            <?php echo Mage::getBlockSingleton('directory/data')->getCountryHtmlSelect($countryId) ?>

The variable that is passed to getCountryHtmlSelect function i.e $countryId, I get the value of this variable through this code

<?php
    $checkout = Mage::getSingleton('checkout/session')->getQuote();
    $countryId = $checkout->getBillingAddress()->getCountryId();
?>

This code is also on the same page i.e cart.phtml

Now on country select I am making a ajax call. Here is the code

jQuery('#country').change(function(){
var countryId = (jQuery(this).val());
//jQuery('.totals-inner-top').html('

');
jQuery.ajax({
    url: "<?php echo $this->getUrl('checkout/cart/custom_update_country')?>",
    dataType : 'json',
    type : 'POST',
    data: {'country_id': countryId},
    success : function(data)
    {
        if(data.status == 1)
        {
            //jQuery('.totals-inner-top').html(data.refreshtotalBLK);
            location.reload();
        }
        else
        {
            if(data.status == 0)
            {
                alert(data.error);
            }
        }
    }
    });

});

Now my custom function that is hit on ajax call.It is in CartController.php

public function custom_update_countryAction()
{
    try {
        $country_id = $this->getRequest()->getParam('country_id');
        $code = 'tablerate_bestway';

        $address = $this->_getQuote()->getBillingAddress()->setCountryId($country_id);

        $this->_getQuote()->getShippingAddress()
            ->setCountryId($country_id)
            ->setShippingMethod($code)
            ->setCollectShippingRates(true)
            ->collectTotals();

        $this->_getQuote()->save();
        $this->_getSession()->setCartWasUpdated(true);

        $response['status'] = 1;
        //$html = $this->getLayout()->createBlock('checkout/cart_totals')->setTemplate('checkout/cart/totals.phtml')->toHtml();
        //$response['refreshtotalBLK'] = $html;
    } catch (Exception $e) {
            $response['status'] = 0;
            $response['error'] = $this->__('Can not save country.');
    }
    return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));

}

Explainaation of the function.
I am getting country code in variable $country_id and setting it as country for billing address and shipping address and the value of $code='tablerate_bestway' ,I am setting it as shipping method. From magento admin panel I have enabled table rate shipping method and exported my tablerates.csv with appropriate content.
Now when country is selected from dropdown then the function runs and everything works as expected. A screenshot of totals section on cart page

Delivery gets changed according to tablerates.csv Everything works fine.
When I try to do the same thing without page reload then it doesn't work as expected. Delivery gets updated but totals keep on increasing with respect to previous total. I can't understand why this happening. For code to change total without page reload just uncomment the commented lines.And you have to comment location.reload(). If anyone have any idea then please help

Please check the screenshot. Total becomes 90 after 4 to 5 ajax call. It keeps increasing on every ajax call with respect to previous total.


texts: Magento 2 - use LESS variables in custom LESS file

texts:
I added bootstrap 4 to my site, but it overwrites many magento 2 core css.
So I added a new file THEME\web\css\bootstrap.less where I try to fix these problems, and added it to my THEME\Magento_Theme\layout\default_head_blocks.xml.
THEME\web\css\bootstrap.less:
body {
    font-family: 'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif !important;
    font-size: @font-size__base;
    line-height: 1.42857143;
}

.nav { display: block; }

But if I compile then I get NameError: variable @font-size__base is undefined in pub/static/frontend/company/fresh/de_DE/css/bootstrap.less on line 3, column 16:, because I am using the variable @font-size__base which is defined in lib\web\css\source\lib\variables\_typography.less
How can I use magento less core variables in my custom css file?
My theme inherits from magento luma.


texts:
I would like to access some attributes of a simple products parent. By this I mean: I have a configurable product with an additional manufacturer property. The configurable product can be configured by a size attribute. In the catalogue one can only see the configurable products, BUT on the cart view this is different. I would like to display the manufacturer, but since the product is a child product, the value of

$_product->getAttributeText('manufacturer');

is just an empty string.

So I load the parent product, using this code:

$parentIds   = Mage::getResourceSingleton('catalog/product_type_configurable')
                       ->getParentIdsByChild($_product->getID());

$parent      = Mage::getModel('catalog/product')->load($parentIds[0]);

THE ONLY PROBLEM I have is that $parentIds is sometimes an empty array, even if the product is a child of a configurable one.

When does this come to happen?


texts: prototype window pop up document.observe function error. TypeError: $$(...)[0] is undefined

texts:
I keep getting this error and my lack of JS knowledge is not helping.

I ripped this code from another post.

function showPopup(sUrl, id) {
    oPopup = new Window({
        id: id,
        className: 'magento',
        url: sUrl,
        width: awidth,
        height: aheight,
        minimizable: false,
        maximizable: false,
        showEffectOptions: {
            duration: 0.4
        },
        hideEffectOptions: {
            duration: 0.4
        },
        destroyOnClose: true
    });
    oPopup.setZIndex(100);
    oPopup.showCenter(true);
}

document.observe("dom:loaded", function () {
    $$('button selector')[0].observe('click', function (oEvent) {
        showPopup($(this).readAttribute('href'));
        Event.stop(oEvent);
    });
});

I tried assigning the id as well. where id: 'theid'

document.observe("dom:loaded", function() {
    $$('theid')[0].observe('click', function(oEvent) {
        showPopup($(this).readAttribute('href'));
        Event.stop(oEvent);
    });
});

The pop up works I'm using this function for compare and the newsletter but I can't get rid of the error. I modified the function a bit but this is the original code. More specifically I'm using prototype/window.js with the magento css theme.


texts: templates call other blocks method - Magento 2

texts:
We can define templates and block in layout file, after that we can call block methods in that template file.

My question is

Is there any way to call other block methods in phtml file(template file)?


texts: What is the best practice to save a module state on Magento 2.3.x?

texts:
I need to save/retrieve information gathered my module. The information might be anything big or small. There may be one or many variables to save and retrieve.

I have identified three ways to save a module state in Magento :

Using Config (core_config_data).
Using Variable (variables) also known as "Custom variables".
Using own resources using a new table in the database.

Which one should I use to save a module state?
Are there known best practice for this scenario?


texts: Magento Full Page Cache Expires in 2 hours

texts:
Is there any idea why Magento Enterprise Full Page Cache Expires in 2 hours ?

When does EE FPC expire?
I found this link , but i dont know what exact code i need to put in local.xml.
Is there any other settings that solves the Full page cache expire issue?

Thanks


texts: How to programmaticlly create custom shipping method for third party API

texts: How to create custom shipping like DHL, UPS, ... in magento 2 so I will be able to connect to third party API and get all the data to create package, tracking numbers and labels? Is there any skeleton Carrier class how to do such thing?


texts: Problem with shipping confirmation email

texts:
I have this very strange problem regarding the sending of the shipping confirmation email.

The cron task sales_send_order_shipment_emails kept failing, so I looked at the logs and I have this:

[2020-03-20 07:07:05] main.ERROR: Cron Job sales_send_order_shipment_emails has an error: Call to undefined method ArrayIterator::setType(). Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":190214144,"emalloc_start":172675232} [] []
[2020-03-20 07:07:05] main.CRITICAL: Error when running a cron job {"exception":"[object] (RuntimeException(code: 0): Error when running a cron job at /var/www/html/public_html/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:327, Error(code: 0): Call to undefined method ArrayIterator::setType() at /var/www/html/public_html/vendor/zendframework/zend-mail/src/Message.php:406)"} []

I looked at and got this:

$header->setType('multipart/mixed');
$header->addParameter('boundary', $mime->boundary());

So I commented this 2 lines out and the blocked emails arrived, all of them fused together in a single email, this line was separating them:

 This is a message in Mime Format. If you see this, your mail reader does not support this format. --=_5a8c092ef2afea588e3cdba2658f0f49 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

So I thought that there must be something with the email template, but this wasn't touched since may last year.

Then I switched off the asynchronous sending mode, as there aren't too many orders now, but this is not a long term solution.

Any ideas where to start debug this?

We are on Magento 2.3.1.


texts:
I am working on magento 2 and i want to open popup in my product detail page. But i have found problem with jquery issue and its not come every time.

Here is my requirejs-config.js

var config = {
    map: {
        '*': {
            jQuerylib: 'Magento_Catalog/js/jquery-1.12.5.min',
            colorbox: 'Magento_Catalog/js/jquery.colorbox-min',
        }
    }
};

And my js function on wrapper.phtml

requirejs(['jquery','domReady!','colorbox'], function(jQuery){

    jQuery( ".scustomization a" ).click(function() {

        jQuery.colorbox({
                width: "90%",
                height: "90%",
                iframe: true,
                href: _url + coString,
                opacity: 0.6,
                escKey: false,
                overlayClose: false,
                onComplete: function() {
                        var theframe = jQuery('#colorbox').find('iframe')[0];
                        theframe.src = _url + coString + "&t=" + d.getTime();
                }
        });
        return false;
    });

});

I have error like bellow


texts: I have a drop down list, which is generated by <?php echo $this->getValuesHtml(); ?>. Now I would like to store those values in an array. How can I do that ??


texts: Locked out of admin panel and can't get support

texts: I cannot login to admin panel and every time I try to reset the password, I receive a password reset email that is broken/incomplete. The text stops mid sentence and where a link should follow, there is no link. I can't lodge a support ticket because Im using community edition. How can I get support? Please help.


texts: How can i Update Add and Delete user address in Application using PUT http://Base URL/rest/V1/customers/me?

texts:
I am working on Magento -2.2.4. and working with REST API.

When The customers are having multiple addresses. When i am trying to update one address from list of existed addresses of the customer, The current updating address is updating fine. But, Remaining all existed addresses are deleted.

I followed this : https://www.ipragmatech.com/edit-delete-address-magento-mobile-app/

How can i update the customer's address with out deleting remaining addresses in application with magento?


texts: Magento 1.9 show productData on catalog/product/list.phtml

texts:
I am trying to display an if statement for products to show Item details if they exist. Otherwise display an attribute.

<?php echo $_product->getAttributeText('filter_metal'); ?>

and it displays the attribute no problem as it exists.

But however I want to check for an item detail first (not an attribute) and then if that exists to display this instead.

On the product page I can get this product detail by;

<?php echo $_product->getData('metal_type'); ?>

but on the category list page it does not.. I am sure I am missing something.
Any assistance is great.

Here is what I was trying also to get if else;

<?php if ($_product->getData('metal_type')): ?>
<?php echo $_product->getData('metal_type')?>
 <?php else:?>
<?php echo $_product->getAttributeText('filter_metal'); ?>
<?php endif;?>

Any help is much appreciated.


texts: Magento 2 : get "Catalog Input Type for Store Owner" value

texts:
I create an attribute like this

how to check in list.phtml

if(attribute == "yes"){
show block
}else{
don\'t show any thing
}

Update:
I get it like this:

$_product->getAttributeText("stock_display");

but it always returns "no" Although I have set some product "yes"

Any help? Thank in advance.


texts: Catalog view template to handle product with custom option

texts:
Looking for disabling select dropdown on product detail page for simple product with custom options. & Would like instead using onclick swatches (tiny images or links) which behave in same way, on select works.

Here is the snapshot for what i want to express:

Which template view should i edit to achieve this?

P.S. none of the product type (simple, grouped or confiurable) exist in my theme
[frontend/default/galayomarket/template/catalog/product/view directory  ]


texts: How to write a Conditional Selection SQL QUERY in Magento2?

texts:
$collection->getSelect()->where($getMainTableAlias.'.entity_id IN (SELECT catText.entity_id FROM '.$catalogCategoryEntityTextTable.' as catText where catText.attribute_id="'.$attributeId.'" AND  FIND_IN_SET("'.$groupId.'", catText.value) GROUP BY   catText.entity_id)');

I have this query. I have to remove the first where clause so as to avoid any filters but the rest will remain same. How can I perform this task?


texts: Error Enter Valid date at cart price rule and save it db, after adding time in date picker in Magento 2.2.6

texts:
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="rule_information" sortOrder="10">
        <field name="from_date" formElement="date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="options" xsi:type="array">
                        <item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>
                        <item name="timeFormat" xsi:type="string">HH:mm:ss</item>
                        <item name="showsTime" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
        <field name="to_date" formElement="date">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="options" xsi:type="array">
                        <item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>
                        <item name="timeFormat" xsi:type="string">HH:mm:ss</item>
                        <item name="showsTime" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

This is my sales_rule_form.xml
i changed dB column as VARCHAR/datetime, its showing invalid date, and how can i save it in db.


texts:
I am getting all product sku's that does not have a attribute value

  'image_link'.

I have written this code in magento :

$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('image_link', array('null' => true));

When i Echo the sql Query I get the below query

echo $products->getSelect();

SELECT `e`.*, `at_image_link`.`value` AS `image_link` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_entity_text` AS `at_image_link` ON (`at_image_link`.`entity_id` = `e`.`entity_id`) AND (`at_image_link`.`attribute_id` = '143') AND (`at_image_link`.`store_id` = 0) WHERE (at_image_link.value IS NULL)

This returns me proper result .

I want to create a report based on this . Using filters .
So i need to change this to a proper query in magento model something like below :

protected function _initSelect()
{
    $this->getSelect()->reset();
    $catalogProductEntitytable = Mage::getSingleton('core/resource')->getTableName('catalog_product_entity');
    $this->getSelect()->from($products->getSelect());
    $this->getSelect()->columns(array(
                                    'sku',
                                ))
                            ->joinLeft( array( 'catalog_product_entity' => $catalogProductEntitytable ),
                                    'catalog_product_entity.entity_id = registry_products.product_id',
                                    array('sku' ) )
                            ->where('registry_products.product_status = ?', 'active')
                            ->where('catalog_product_entity.sku is not null')
                            ->order('registry_products.registry_id');
    return $this;
}

This is another collection model .I tried a few code changes but nothing seems working . Can anyone guide me .Thanks.


texts: Magento 2 difference between ResourceConnection and Resource

texts:
I'm trying to make direct sql queries. In CustomBlock.php I have the following:

namespace My\AdminSample\Block\Adminhtml;

use Magento\Backend\Block\Template;
use My\AdminSample\Helper\ConfigHelper;
use My\AdminSample\Model\AdminSample;
use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Backend\Block\Widget\Tab\TabInterface;

class CustomBlock extends \Magento\Framework\View\Element\Template
{
    /**
     * @var \My\AdminSample\Helper\ConfigHelper
     */
    protected $_config;

    protected $_adminSampleModel;

    protected $_resource;

    protected $connection;

    /**
    * @param Context $context
    * @param array $data
    */
    public function __construct(
        // \Magento\Framework\App\ResourceConnection $resource,
        \Magento\Framework\App\Resource $resource,
        \Magento\Framework\Registry $registry,
        Template\Context $context,
        AdminSample $adminSampleModel,
        ConfigHelper $config,
        array $data = []
        ) {
        $this->_resource = $resource;
        $this->_coreRegistry = $registry;

        $this->_config = $config;
        $this->_adminSampleModel = $adminSampleModel;
        parent::__construct($context, $data);
    }

    public function getConnection()
    {
        if (!$this->connection) {
            $this->connection = $this->_resource->getConnection('core_write');
        }
        return $this->connection;
    }
    public function getDirectQuery()
    {
        $table  = $this->_resource->getTableName('table_name_here');
        $sku    = $this->getConnection()->fetchRow('SELECT * FROM `'.$table.'`');
        return $sku;
    }

Now if I comment:

  \Magento\Framework\App\ResourceConnection $resource,

i receive

  Invalid block type: My\AdminSample\Block\Adminhtml\CustomBlock

but if i comment

  \Magento\Framework\App\Resource $resource,

the result is

  Notice: Array to string conversion in
  /public_html/vendor/magento/framework/HTTP/PhpEnvironment/Response.php
  on line 54


texts:
I would like to edit the search results page to include a side bar with content such as some links, can someone please tell me the file to edit? Do I need to create a new template?

Help me out please.


texts: Unable to retrieve custom attribute after enabling "Use Flat Catalog Product"

texts:
I have a custom attribute for the product, Which is a Multi-select. I created this attribute with php script as shown below. The attribute's "Used in Product Listing" is set to true. But im unable to access this on front-end.

$installer = new Mage_Sales_Model_Mysql4_Setup;

    $attributeLabel = 'Choose Active Product Store';
    $attributeCode  = 'active_stores';
    $attributeGroup = 'General';
    $attributeOrder  = 100;

    $attributeOptions2 = array(
        'label'                      => $attributeLabel,
        'input'                      => 'multiselect',
        'type'                       => 'text',
        'backend'                    => 'eav/entity_attribute_backend_array',
        'frontend'                   => null,
        'source'                     => 'storeSwitcher/product_attribute_source_store',
        'global'                     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'required'                   => false,
        'user_defined'               => false,
        'required'                   => true,
        'class'                      => null,
        'unique'                     => false,
        'searchable'                 => false,
        'filterable'                 => false,
        'comparable'                 => false,
        'visible_on_front'           => true,
        'is_configurable'            => false,
        'visible'                    => true,
        'default'                   => 'none',
    );

    $installer->updateAttribute(
        Mage_Catalog_Model_Product::ENTITY,
        $attributeCode,
        $attributeOptions2, $attributeCode
    );

    foreach ($attributeSets as $attributeSet) {
        $installer->addAttributeToSet(
            Mage_Catalog_Model_Product::ENTITY, $attributeSet,
            $attributeGroup, $attributeCode, $attributeOrder
        );
    }

i cannot filter the product collections based on this attribute.
When i checked the catalog_product_flat_xx table i cannot find the column for this attribute!

Magento 1.9.2.4 CE


texts: Magento 2 module Object DOMDocument should be created?

texts:
I am working on Magento 2.0.4 . I need to get collection of my custom table. For this I created the function getAreaCollection() in my block file but I got following error when I add constructor in block file.

Object DOMDocument should be created.

Here is my block file (\app\code\Techno\Area\Block\Area\index.php):-

namespace Techno\Area\Block\Area;

use Techno\Area\Block\BaseBlock;
use Techno\Area\Model\Area as AreaModel;
use Techno\Area\Model\Status;

class Index extends BaseBlock {

    protected $_areaFactory;
    protected $_area;
    protected $_areaCollectionFactory;
    protected $_areaHelper;

    public function __construct(
        Magento\Framework\View\Element\Template\Context $context
        Techno\Area\Model\ResourceModel\Area\CollectionFactory $areaCollectionFactory,
        Techno\Area\Model\AreaFactory $areaFactory,
        AreaModel $area,
        Techno\Area\Helper\Data $areaHelper
    ) {
        parent::__construct($context);
        $this->_areaFactory = $areaFactory;
        $this->_area = $area;
        $this->_areaCollectionFactory = $areaCollectionFactory;
        $this->_areaHelper = $areaHelper;
    }

    public function getAreaCollection() {
        $areaCollection = $this->_areaCollectionFactory->create()
                ->addFieldToFilter('status', Status::STATUS_ENABLED)
                ->setOrder('area_name', 'ASC');

        return $areaCollection;
    }

}

Can anyone guide me to make this working ?


texts: How do I make sure Google doesn't index simple products that are linked to configurable products?

texts:
I am getting ready to restructure my product database to use configurable products instead of custom options. I want the configurable products to be indexed by Google, but not the related simple products, since this would create duplicate content. If I have the products set as "Not Visible Individually" will this keep them from being crawled by Google or do I need to do something else?

I read a couple posts from people saying that google was crawling product pages that weren't visible and creating 404 erros so I'm wondering if that was the best practice is.


texts: How to use group price as primary price?

texts: I set group price for group "Dealer". But I can't see this price in the frontend. I have enabled displaying in frontend area in attributes form, but I can't see this price still. Could you help me please?


texts: Custom Adminhtml Controller Post to Template

texts:
I have a file mytemp.phtml that I make a post request in and I would like this controller to retrieve it, then pass it back to mytemp.phtml. My controller is not being read by Magento though and I can't find my error. Also, once I get it to be read how do I pass that post retrieval to mytemp.phtml, thanks

config.xml:

<config>
    <-- other -->
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <mymodule before="Mage_Adminhtml">MyApp_MyModule_Adminhtml</mymodule>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <!--other-->
</config>

MyApp\MyModule\controllers\Adminhtml\ButtonController.php:

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


texts: Magento use associated simple product image for configurable product

texts:
Is it possible to make Magento use the image of a simple attached product on configurable products?

So if one of the simple products have an image, add it to the configurable product, else use placeholder image?

We have +50k products coming in via csv and new ones being added every day, but the configurable product has no image from the csv. So we need to do this for the existing database and for new products, that are being added.

We are using v1.9.2.4


texts: Custom theme not working in Magento 2.3. As well as the default.xml

texts:
It seems that my custom theme is not working as well as my default.xml. For now, I am trying to remove the copyright part for Luma but when I override the existing theme, my default.xml is not working.

Here is the code for my default.xml

<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body>
     <referenceBlock name="logo">
     <argument>
        <argument name="logo_file" xsi:type="string">images/dad.svg</argument>
        <argument name="logo_alt" xsi:type="string">Tienda Theme</argument>
        <argument name="logo_img_width" xsi:type="number">250</argument>
        <argument name="logo_img_height" xsi:type="number">250</argument>
      </argument>
   </referenceBlock>
   <referenceBlock name="copyright" remove="true" />
 </body>
</page>


texts: Magento 2: Update customer custom attribute value in observer

texts:
I have created a custom attribute by the help of this link. Now I have to save/update value of this attribute in customer_save_before event observer.

Here is my observer.php code:

namespace Vendor\Module\Observer;
use Magento\Framework\Event\ObserverInterface;

class RegisterUserOnCoop implements ObserverInterface
{
    /**
    * @var \Magento\Framework\App\ResponseFactory
    */
    protected $_customerRepositoryInterface;

    public function __construct(
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface,
    ) {
        $this->_customerRepositoryInterface = $customerRepositoryInterface;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customerData = $observer->getEvent()->getCustomer();
        $customerData->setCustomAttribute('customer_attribute', $value);
        $this->_customerRepositoryInterface->save($customerData);
    }
}

Any help will be appreciated?


texts:
In Shopper theme, there's a custom variable in skin\frontend\shopper\default\js\script.js file of the theme, it's not instantiated in this file, however it's called:

if (Shopper.totop) {
    $().UItoTop({scrollSpeed:400});
}

I made some modifications in the theme and now i'm getting this error in the console:

Uncaught ReferenceError: Shopper is not defined

I can see in template/page/html/head.phtml that the variable is instantiated:

<script type="text/javascript">
    //<![CDATA[
    var Shopper = {};
    Shopper.price_circle = <?php echo Mage::getStoreConfig('shoppersettings/design/price_circle') ?>;
    Shopper.fixed_header = <?php echo Mage::getStoreConfig('shoppersettings/design/fixed_header') ?>;
    Shopper.totop = <?php echo Mage::getStoreConfig('shoppersettings/ajax/totop') ?>;
    Shopper.responsive = <?php echo Mage::getStoreConfig('shoppersettings/design/responsive') ?>;
.
.
.
.
</script>

Where's the problem then?, can anyone give a hint?. Thanks!


texts: Magento 2 - Override phtml files not working

texts:
I am working on Magento 2 and I override few PHTML files from

  vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml

to

  app/design/frontend/vendor/module/Magento_Catalog/templates/product/list/items.phtml

From few days my app/design > items.phtml not working, showing vendor items.phtml layout. Working fine before.

I also run all these commands.

php magento setup:upgrade
php magento setup:di:compile
php magento setup:static-content:deploy -f

php magento indexer:reindex
php magento cache:flush

Please help?


texts: Magento 2.06 php bin/magento setup:upgrade error

texts:
I am trying to install a theme on Magento 2.06. When I try to run the following command: php bin/magento setup:upgrade but I receive the following error:

Content-type: text/html

Parse error:  syntax error, unexpected '[', expecting ')' in /home/bargaink/public_html/test/bin/magento on line 22

Any idea what the issue is?

Thanks

HP


texts: Magento 2: Custom url for state=onsale produtcs

texts:
Right now I'm able to see all my on sale products here:

http://wwww.domain.com/products?state=onsales

(products is a category that lists all products)

I would like to change that url or create a new one with:
http://wwww.domain.com/promotions

What's the best way to achieve this?

Do I need to create a new module with custom url and then list all the products on sale?


texts:
URL Rewrite issue - category/sub-category/product urls not working.

When I create a new product it does not create the pretty urls, instead it defaults to the system urls. Could it be because they could be in a competing parent category structure when created?

Example:

If I'm selling flip flops and upon creation I put them in competing categories would that cause confusion and would it just default to the system URL?

mywebsite.com/products/clothing/accessories/shoes/flipflops.html

mywebsite.com/specials/shoe-specials/flipflops.html


texts: how to copy existing subcategory into another category programatically in magento1?

texts: How can I copy existingg subcategory into another category.Can you please help me?


texts:
I am trying to add a weight column to my magento order grid (I want the total weight of the order)

I have this part

_prepareColumns

$this->addColumn('weight', array(
        'header' => Mage::helper('sales')->__('Weight'),
        'index' => 'weight',
        'filter_index' => 'sfo.weight',
        'width' => '50px',
    ));

The column is shown, but no data is displayed

I think I need to add something in front of _prepareCollection();

Does anyone know the correct code for this?

below is the collection part i have already

protected function _getCollectionClass()
{
    return 'sales/order_grid_collection';
}

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());

    $table = Mage::getSingleton('core/resource')->getTableName('sales_flat_shipment_grid');
    //$collection->getSelect()->from('', "((select max(t.created_at) from `$table` as t where t.order_id=main_table.entity_id)) as shipped_date");
    $collection
        ->getSelect()
        ->joinLeft(array('t'=>$table), 'main_table.entity_id = t.order_id',array('shipped_date'=>'created_at'))
        ->group('main_table.entity_id');;
    //file_put_contents(basename(__FILE__).".txt",__LINE__.":sql: ".$collection->getSelect()."\r\n",FILE_APPEND);
    $this->setCollection($collection);

    $collection->getSelect()->joinLeft(array('shipping'=>'sales_flat_order_address'),
    'main_table.entity_id = shipping.parent_id AND shipping.address_type="shipping"',array('shipping.postcode AS sp'));

    return parent::_prepareCollection();
}


texts: Versioned Static Content not Being Compressed

texts:
On my live server my versioned content (the url containing the versioned number) is not returning the static files compressed.  However when I check the literal path to the content, by removing the “versionXXXXXX” from the url and resending the request, the content is being compressed and returned as so to the browser.  I have my htaccess file in pub/static that does the rewrite properly.  Can anyone help me out as to why the versioned url is not returning the compressed content to the browser?

On my local server, the versioned content is being gzipped properly.  Accept-Encoding headers are being read properly and in turn returning the compressed content to the browser.  But this is not the case on my live server.


texts: 504 gateway timeout while import customer address CSV In Magento2

texts:
http://website.com/admin/admin/import/validate/key/40cc16dabfa0d1fb09a6cb9e62433b9880e4f3f0e024eb1c517d832fa47c225d/?form_key=s235x0mqERyjXLqX 504 (Gateway Timeout)
  `validation.js:185

while Import customer address csv in admin.
What is solution?


texts:
after updating some outdates addons, i got this error on my site, and its not running...

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.value) = '0') AND (start_time <= '2017-03-12') AND (end_time >= '2017-03-' at line 2, query was: SELECT main_table.* FROM bannerslider_banner AS main_table LEFT JOIN bannerslider_value AS status ON main_table.banner_id = status.banner_id AND status.store_id = 1 AND status.attribute_code = 'status' WHERE (bannerslider_id = '1') AND (IF(status.value IS NULL, main_table.status, status.value) = '0') AND (start_time <= '2017-03-12') AND (end_time >= '2017-03-12') ORDER BY order_banner ASC

any hints?


texts: Paypal Payment Declined Please Try Again

texts:
Been having this problem for nearly a week now and PayPal technical support is basically lost and of not much help.

I'm running PayPal Advanced, when a customer (or myself) checks out of the store with a credit card, they get a pop up saying 'payment declined, please try again'. The problem is, is the payment actually goes through to paypal but the order ends up canceled in the orders in the admin of magento.

It's an odd problem, as it started happening about a week ago, but it does happen with EVERY order. Doesn't look like it's either user error, nor is it a problem with one specific product.

As said above, I've called paypal on this and they say my account is setup and integrated fine, but they can't find the issue. They thought it might be a silent post issue, but they haven't confirmed that yet.

I have debug mode on but have no idea what i'm looking at in the file - nor do i have the knowledge on how to try to see what other error might be happening between the submitting of info and the decline notice.

I was running 1.7.0.1 and have since moved to 1.9.0.1 and upgrading didn't solve the issue either.

I also tried what was posted over here, but that didn't work either: http://www.magentocommerce.com/boards/viewthread/991120/

Any help or insight would be wonderful


texts: Trying to create an extension for new Custom Mass Status action update

texts:
I am using Magento 1.9.1 .
I am working on a new extension which is adding new custom mass status action here:

Here is my code:
/app/code/local/VivasIndustries/MassCustomStatusses/etc/config.xml :
<?xml version="1.0"?>
<config>
  <modules>
    <VivasIndustries_MassCustomStatusses>
      <version>0.1.0</version>
    </VivasIndustries_MassCustomStatusses>
  </modules>
  <admin>
    <routers>
        <masscustomstatusses>
            <use>admin</use>
            <args>
                <module>VivasIndustries_MassCustomStatusses</module>
                <frontName>masscustomstatusses</frontName>
            </args>
        </masscustomstatusses>
    </routers>
</admin>
<global>
    <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_grid>VivasIndustries_MassCustomStatusses_Block_Sales_Order_Grid</sales_order_grid>
            </rewrite>
        </adminhtml>
    </blocks>
</global>
</config>

/app/code/local/VivasIndustries/MassCustomStatusses/Block/Sales/Order/Grid.php:
<?php
class VivasIndustries_MassCustomStatusses_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
{
    protected function _prepareMassaction()
    {
        parent::_prepareMassaction();

        // Append new mass action option
        $this->getMassactionBlock()->addItem(
            'masscustomstatusses',
            array('label' => $this->__('New Mass 1'),
                  'url'   => $this->getUrl('masscustomstatusses/controllers/NewMass') //this should be the url where there will be mass operation
            )
        );
    }
}

/app/code/local/VivasIndustries/MassCustomStatusses/controllers/IndexController.php:
<?php

class VivasIndustries_MassCustomStatusses_IndexController extends Mage_Adminhtml_Controller_Action
{

    public function NewMassAction()
    {
        // Update status here
        // Can fetch selected items with $this->getRequest()->getParam()

        die('Looks like it works');
    }

}

So here is what i've done by this guide: http://www.blog.magepsycho.com/adding-new-mass-action-to-admin-grid-in-magento/
When i select New Mass 1 and i click Sumbit i got error 404

I got this error on URL: http://mymagento.com/index.php/masscustomstatusses/controllers/NewMass/key/3ae4179b29ad706ef167e91bacf57c76/
Can you please help me fix this error?
NOTE: I've made this controller by instructions of this answer: Adding new custom mass order status action
Thanks in advance!


texts: Customer/Account don't allow edit password

texts:
My Magento Users, use external system to login in my store.
So I would like, to disable some options in "Account Dashboard".
First, I need to disable allow to the user to change the password. ¿It's possible? What I've to do?
Thanks.


texts:
I have error on checkout page (see the image) .
Continue button is not working. Any luck ?


texts: M2: Admin grids (store config) - how to add "rowspan" to table fields?

texts:
How can I create an admin grid that uses "rowspan" property?

We want to have (something like) the good old M1 store config page ;)

Haven't checked M1 code yet, but maybe someone has an idea ...

There is a getRowspan() method in

app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php
app/code/Magento/Backend/Block/Widget/Grid/Extended.php

.. but, "how to use it"?


texts: Magento 2: How to move block inside a new container in layout XML?

texts:
I'm trying to wrap the .product-info-main div on the product page inside a new container div (.product-info-container). After following the Magento layout instructions, it's not behaving as expected. Here's what I have in catalog_product_view.xml right now:

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <container name="product.info.container" htmlTag="div" htmlClass="product-info-container" before="-"/>
            <move element="product.info.main" destination="product.info.container"/>
        </referenceContainer>
    </body>
</page>

The layout doesn't change at all. However, if I remove the <referenceContainer> level, then it works as expected, but the .product-info-container div is inserted at the bottom of the page.


texts: Magento: Set paid an order before making the bill

texts: I'm trying to understand if there's a way to set and order, that must be paid with bank transfer, paid when I check that money as arrived on my account, and then after that make the bill some day after.. Because I don't find where to change the status, whitout making the bill. My need is to set paid to create than an observer that send an email to my supplier to start to produce goods to sell. So the customer must also wait 15 days, so the shipment and the bill can be done in the next month. For this reason an need a medium point between order and bill. Thank you! Bye


texts: Insert custom block before "col-left-first" ( customer account panel )

texts:
Here's a screenshot to illustrate my question.
http://prntscr.com/ejyfd3

I want to insert a custom block title.phtml with a default title for all pages in Customer Account.

Where i trying customer.xml
http://prntscr.com/ejyl9l

Inside "root" reference, i put the <block type="core/template" name="customer_section_title" template="customer/account/title.phtml"/> but the block not show.

If i put the same code in "content" reference, it shows.

Any ideas?
I'm learning magento yet, not sure about some things


texts:
i admin panel admin can see login customers last login details.
i want to know where can admin check / see his last login i can not find it please guide me .

it is necessary for security purpose


texts: How to update UPS moduel of magento 1.6 to UPS Module of 1.9

texts:
I am running Magento 1.6, Here UPS shipping module is not update, I mean it is not using userID, password and access key.

So I want to upgrade UPS module with latest one, But not want to upgrade entire magento project.

Please suggest, How I can do this.


texts: Price always empty when create product programatically

texts:
I am trying to create the product programatically,  like this:

 Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
 $data0['name'] = 'Gundamz';
 $data0['sku'] = 'Gundamz123';
 $data0['weight'] = 2;
 $data0['status'] = 1;
 $data0['attribute_set_id'] = 4;
 $data0['tax_class_id'] = 0;
 $data0['visibility'] = 4;
 $data0['description'] = 'Gundam Blade';
 $data0['short_description'] = "Authentic Gundam Blade";
 $data0['price'] = "20033.32";

 $product = Mage::getModel('catalog/product');
 $product->setTypeId('simple');
 $product->setAttributeSetId($dat['attribute_set_id']);
 $product->setData($data0);
 $product->save();

but the price and weight always empty after I save the product.

Any idea, how to fix this ?


texts: How to reduce Magento search autocomplete dropdown time delay?

texts:
I am using Magento CE 1.9.1.0

How do I make dropdown suggestions for search input appear quicker when typing?


texts: How to get customer address with address id

texts: Can i get customer address like picture below with address id? If i can, how should i do it?


texts: How to retrieve category tree for individual products?

texts:
I am trying to create an export of a products sku and its category tree. Obviously getting the category Id's is simple enough but I need to turn that array of Id's into text category paths.

ie: lets say that product with sku "xyz123" is in "root/plumbing/pipes" and is also in "root/someother/accessories", currently I can retrieve the array of Id's but what is a good way to reconstruct each of those text trees?

EDIT: Using the example that was posted below, I created a class from the modified example to create what I was looking for.

class categories
{
  protected $_index = array();

  public function __construct() {
      $root = Mage::app() -> getStore() -> getRootCategoryId();
      $this -> _initCategoryTree($root, false);
  }

  public function getCategory($id) {
      return $this -> _index[$id] ? : false;
  }

  public function toHtml() {
      $index = $this -> _getIndex();
      $html = "

line	key	value
";
      $iter = 0;
      foreach ($index as $k => $v) {
          $html .= "
";
          $html .= "" . $iter++ . "	";
          $html .= "" . $k . "	";
          $html .= "" . $v . "	";
          $html .= "
";
      }
      $html .= "
";
      echo $html;
  }

  private function _initCategoryTree($rootId, $isChild, $parentName = null) {
      //@formatter:off
      $collection = Mage::getModel('catalog/category')
          -> getCollection()
          -> addAttributeToSelect('*')
          -> addAttributeToFilter('parent_id', array('eq' => $rootId));

      //@formatter:on
      $index = array();

      foreach ($collection as $category) {
          $name = $category -> getName();
          $id = $category -> getId();

          $index[$id] = $name;

          $children = $category -> getChildren();
          $subIndex = array();

          if ($children != '') {
              $subIndex = $this -> _initCategoryTree($id, true, $name);
              foreach ($subIndex as $key => $child) {
                  $this -> _index[$key] = $child;
                  $this -> _index[$key] = $name . DS . $this -> _index[$key];
                  if (null !== $parentName)
                      $this -> _index[$key] = $parentName . DS . $this -> _index[$key];
              }
          }

      }

      if (!$isChild) {
          foreach ($index as $key => $category) {
              $this -> _index[$key] = $category;
          }
      }

      return $index;
  }

  private function _getIndex() {
      if (null === $this -> _index)
          return false;
      return $this -> _index;
  }

  private function _dump($value) {
      echo "
";
      ob_start();
      var_dump($value);
      echo ob_get_clean();
      echo "
";
  }

}

$cTree = new categories();
//toHtml is just a quick method to dump the index as an html table for debug purposes.
$cTree -> toHtml();


texts: Magento 2: How to change the position of category

texts:
I am working simple Magento site and my task is to change position in a category.

In this screenshot, top category and next to custom header, how to change position first see the custom header and next to see category

code is here:

 <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="custom_header"
               as="custom_header" template="Magento_Theme::html/header1.phtml"/>
        <move element="custom_header" destination="panel_wrapper" before="-"/>
    </referenceContainer>


texts: Content > Pages not loading in the back end of Magento 2.1.7

texts:
Recently we have been experiencing issues when trying to access pages on the back end, the page just doesn't load.

We have tried multiple browsers (IE, Chrome, Firefox, Safari) and this had made no difference. This issue has only started happening in the last couple of days.

I'm relatively new to working with websites and this is the first major issues I've encountered.


texts:
I have been added the all information about dhl in magento system >> configuration >> sales >> shipping method but all information about dhl is correct even i had confirmed with dhl office and all info are correct.

But still getting the error from DHL in front-end.

  DHL
      This shipping method is currently unavailable in this location. If you would like to ship using this shipping method, please contact us.

2015-10-09T12:05:47+00:00 DEBUG (7): Array
(
    [request] => <?xml version="1.0" encoding="UTF-8"?>
<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd "><GetQuote xmlns=""><Request><ServiceHeader><SiteID>EMUESIRI</SiteID><Password>dHQIl6aesu</Password></ServiceHeader></Request><From><CountryCode>NG</CountryCode><Postalcode>904103</Postalcode><City>Abuja</City></From><BkgDetails><PaymentCountryCode>NG</PaymentCountryCode><Date>2015-10-09</Date><ReadyTime>PT0H00M</ReadyTime><DimensionUnit>CM</DimensionUnit><WeightUnit>KG</WeightUnit><Pieces xmlns=""><Piece xmlns=""><PieceID>1</PieceID><Weight>0.1</Weight></Piece></Pieces><PaymentAccountNumber>365081821</PaymentAccountNumber></BkgDetails><To><CountryCode>NG</CountryCode><Postalcode>450211</Postalcode><City>Asa </City></To></GetQuote></p:DCTRequest>

    [__pid] => 6197
)

2015-10-09T12:05:47+00:00 DEBUG (7): Array
(
    [0] => Error parsing body - doesn't seem to be a chunked message
    [1] => The response is in wrong format.
    [__pid] => 6197
)


texts: Magento 2 How to create and load custom route page

texts:
I want to add a custom redirect type 410 in URL redirect. I have added this in admin section and configured some pages with 410 redirect.

Now I want to check the redirect type is 410 and if it is 410 I want to display a custom page or text like 404 page. I didn't want to redirect to another URL. I want the same functionality as 404 page.
How can I do it?


texts:
I have two models. The one is intializing the database, the other one i use to run a crontab. But i keep getting this error. Been playing around with it for a long time..

2017-11-29T08:56:03+00:00 ERR (3): Warning: include(Mage/Mycompany/Asynccronjobs/Model/Cron.php): failed to open stream: No such file or directory  in /var/www/mycompany/lib/Varien/Autoload.php on line 94
2017-11-29T08:56:03+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Mycompany/Asynccronjobs/Model/Cron.php' for inclusion (include_path='/var/www/mycompany/app/code/local:/var/www/mycompany/app/code/community:/var/www/mycompany/app/code/core:/var/www/mycompany/lib:.:/usr/share/pear:/usr/share/php')  in /var/www/mycompany/lib/Varien/Autoload.php on line 94

My config.xml looks like this:

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_AsyncCronjobs>
            <version>1.0.0</version>
        </Mycompany_AsyncCronjobs>
    </modules>
    <global>
        <models>
            <asynccronjobs>
                <class>Mycompany_AsyncCronjobs_Model</class>
                <resourceModel>asynccronjobs_resource</resourceModel>
            </asynccronjobs>
            <asynccronjobs_resource>
                <class>Mycompany_AsyncCronjobs_Model_Resource</class>
                <entities>
                    <jobs>

asynccronjobs_jobs

                    </jobs>
                </entities>
            </asynccronjobs_resource>
        </models>
        <helpers>
            <asynccronjobs>
                <class>Mycompany_AsyncCronjobs_Helper</class>
            </asynccronjobs>
        </helpers>
        <resources>
            <asynccronjobs_setup>
                <setup>
                    <module>Mycompany_AsyncCronjobs</module>
                </setup>
            </asynccronjobs_setup>
        </resources>
    </global>
    <frontend>
        <routers>
            <asynccronjobs>
                <use>standard</use>
                <args>
                    <module>Mycompany_AsyncCronjobs</module>
                    <frontName>asynccronjobs</frontName>
                </args>
            </asynccronjobs>
        </routers>
    </frontend>
    <crontab>
        <jobs>
            <Mycompany_AsyncCronjobs>
                <schedule>
                    <cron_expr>* * * * *</cron_expr>
                </schedule>
                <run>
                    <model>asynccronjobs_resource/cron::everyHour</model>
                </run>
            </Mycompany_AsyncCronjobs>
        </jobs>
    </crontab>
</config>

My Mycompany/AsyncCronjobs/Cron.php looks like this:

<?php
class Mycompany_AsyncCronjobs_Model_Cron extends Mage_Core_Model_Abstract
{

    public function everyHour()
    {
        mage::log('got it');
    }
}


texts: Display only sub categories of particular category

texts:
Here is the code which displays all the categories and sub categories

<?php echo $this->renderCategoriesMenuHtml(TRUE, 0, 'level-top'); ?>

I would like to display only subcategories of category id 10.


texts: Send to an extra bcc email on contact form

texts:
I just modified a time before my IndexController.php just to be able to send emails to multiple recipients and it was working fine. I took it from magento.stackexchange. This is what I have now:

$recipients = array(
    'web@domain.com' => 'Web · Domain',
    'extra@domain.com' => 'Extra · Domain'
);

$mailTemplate->setDesignConfig(array('area' => 'frontend'))
    ->setReplyTo($post['email'])
    ->sendTransactional(
        Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
        Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
        array_keys($recipients),
        array_values($recipients),
        array('data' => $postObject)
    );

And now I would like to do a modification. Set the extra@domain.com email as Bcc instead of Cc because we don't want to remove extra@domain.com the whole time from recipients when we want to answer the contact form. We see the user email and the extra email when trying to answer from web@domain.com which is an email used by different people on our company. So we want extra@domain.com just as an information email which will never be used to answer emails. Is this possible at all?

SOLUTION:

$recipients = array(
    'web@domain.com' => 'Web · Domain'
);

$mailTemplate->setDesignConfig(array('area' => 'frontend'))
    ->setReplyTo($post['email'])
    ->addBcc("extra@domain.com")
    ->sendTransactional(
        Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
        Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
        array_keys($recipients),
        array_values($recipients),
        array('data' => $postObject)
    );


texts: Magento 2 - Get Swatch Options from Product Attribute Source Model

texts:
we are trying to create swatch visual and text product attribute programmatically,  we need to give swatch Options Like Source Model.
                \Magento\Catalog\Model\Product::ENTITY,
                'visual_color_group1',
                [
                    'group' => 'General',
                    'type' => 'int',
                    'source' => 'Vendor\Vendor\Model\Product\Attribute\Source\ColorGroupOptions',
                    'backend' => 'Vendor\Vendor\Model\Product\Attribute\Backend\ColorGroupOptions',
                    'frontend' => 'Vendor\Vendor\Model\Product\Attribute\Frontend\ColorGroupOptions',
                    'label' => 'Visual Color Group One',
                    'input' => 'select',
                    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                    'visible' => true,
                    'required' => false,
                    'user_defined' => true,
                    'searchable' => true,
                    'filterable' => true,
                    'comparable' => false,
                    'visible_on_front' => true,
                    'used_in_product_listing' => true,
                    'is_used_in_grid' => true,
                    'is_visible_in_grid' => true,
                    'is_filterable_in_grid' => true,
                    'is_html_allowed_on_front' => true,
                    'unique' => false,
                    'apply_to' => 'simple,virtual,downloadable,bundle,configurable',
                ]
            );

            $this->eavConfig->clear();
            $attribute = $this->eavConfig->getAttribute('catalog_product', 'visual_color_group1');
            if (!$attribute) {
                return;
            }
            $attributeData['option'] = $this->addExistingOptions($attribute);
            $attributeData['frontend_input'] = 'select';
            $attributeData['swatch_input_type'] = 'visual';
            $attributeData['update_product_preview_image'] = 1;
            $attributeData['use_product_image_for_swatch'] = 0;
            $attributeData['optionvisual'] = $this->getOptionSwatch($attributeData);
            $attributeData['defaultvisual'] = $this->getOptionDefaultVisual($attributeData);
            $attributeData['swatchvisual'] = $this->getOptionSwatchVisual($attributeData);
            $attribute->addData($attributeData);
            $attribute->save();

For the Attribute options, we are taking from source model, same as how we can take swatch options from source model ?.


texts: How to assign an order to an email after account create?

texts:
I need a help with magento 2. I noticed that when I place an order as a guest, after checkout i can create an account, when i do this, the order is assigned to this email and this order shows in my account page. But when i place an order, then go to homepage and then create an account using email address which i used to place an order this order does not apear on account page.

Have you any idea how to fix this? Probably add some validation when i creat an account but in which file, how does it work?

Thanks in advance.


texts: Magento 2: How to add text within container via XML

texts:
I am attempting to render a single line of text prior to a Link list in the footer. Creating a template file to do this seems to be a waste of resources for this task. As I understood it, I could output text with a Magento\Framework\View\Element\Text block in the layout.

XML

<referenceContainer name="footer">
  <container name="footer.column.about_us" htmlTag="div" htmlClass="column about-us" before="-">
    <container name="column.about_us.label" htmlTag="div" htmlClass="label">
      <block class="Magento\Framework\View\Element\Text" name="about_us.label">
        <arguments>
          <argument name="data" xsi:type="array">
            <item name="text" xsi:type="string">About Us</item>
          </argument>
        </arguments>
      </block>
    </container>
    <block class="Magento\Framework\View\Element\Html\Links" name="footer_links.about_us">
      <arguments>
        <argument name="css_class" xsi:type="string">footer links</argument>
      </arguments>
    </block>
  </container>
</referenceContainer>

The preceding does not output anything, and I am unsure whether this is unsupported, if I'm just doing it wrong, or if there is another more proper method to accomplish this.

To be clear, what I'm currently seeing is:

...

when I want to see:

About Us

...

Any suggestions?


texts: add error message to order view and stop shipment creation process

texts:
I have created event observer to add tracking numbers automatically.
I am useing this event:  <sales_order_shipment_save_before>

And there is my code for adding tracking number:

public function salesOrderShipmentSaveBefore($observer)
 $shipment = $observer->getEvent()->getShipment();

$contents = '{"error":"can not add tracking number because of..."}';
    //$contents = '{"strid":"12345678900"}';
                $response = json_decode($contents, true);

            if (isset($response['strid']))
            {
                $trackNumber=$response["strid"];
                    $track = Mage::getModel('sales/order_shipment_track')
                                ->setNumber($trackNumber)
                                ->setCarrierCode('mycompany_mymodule')
                                ->setTitle('My Module');
                  $shipment->addTrack($track);
            }
            else if (isset($response['error']))
            { Mage::getSingleton('core/session')->addError($response['error']);

//and there i want to create error message

}

if i have strid field, tracking number is added sucessfully, and this message tells me this. "The shipment has been created".

but how to add error message to that field? With that red field that says "shipment cannot be created" and also there is my message "can not add tracking number because of..."

UPDATE
Oh God, i just solved my a little part of my problem.
this is what need to bee added under else:

Mage::getSingleton('core/session')->addError($response['error']);

But now i have question how not to save shipment, what should i do that if i have error field, how to stop shipment creatin process, to get stage where automatic error "Shipment can not be created" is shown.

UPDATE2
if anyone else will have similar problem then this is solution, i just made redirect to previous page like this:

Mage::app()->getResponse()->setRedirect($_SERVER['HTTP_REFERER']);
        Mage::app()->getResponse()->sendResponse();
            exit;

error is shown and shipment isn't saved, a little bit not excatly in that way how i wanted but this works.


texts: Magento2: How to delete module installed via composer

texts:
I want delete one module installed before via composer.

So I first disable module:
List of disabled modules:

Scommerce_Core
Scommerce_GoogleRemarketing

next:

php bin/magento module:uninstall Scommerce_Core
php bin/magento module:uninstall Scommerce_GoogleRemarketing

Now I delete folder from vendor/scommerce and is issue on website. How to delete it?

update code:

arning: require(/home/czasowe/domains/gerris.pl/public_html/vendor/composer/../scommerce/core/registration.php): failed to open stream: No such file or directory in /home/czasowe/domains/gerris.pl/public_html/vendor/composer/autoload_real.php on line 70

Warning: require(/home/czasowe/domains/gerris.pl/public_html/vendor/composer/../scommerce/core/registration.php): failed to open stream: No such file or directory in /home/czasowe/domains/gerris.pl/public_html/vendor/composer/autoload_real.php on line 70

Fatal error: require(): Failed opening required '/home/czasowe/domains/gerris.pl/public_html/vendor/composer/../scommerce/core/registration.php' (include_path='/home/czasowe/domains/gerris.pl/public_html/vendor/magento/zendframework1/library:.:/usr/local/php71/lib/php') in /home/czasowe/domains/gerris.pl/public_html/vendor/composer/autoload_real.php on line 70


texts: Overriding a block is not work in Magento 2

texts:
This is My di.xml file

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Block\Cart\Item\Renderer" type="Vendor\Modulename\Block\Checkout\Cart\Item\Renderer" />
</config>

and this is my block file

<?php
namespace Vendor\Modulename\Block\Checkout\Cart\Item;
class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer
{
    public function theFunctionYouWantToRewrite()
    {
        // Do your custom stuff
    }
}

but this is not work how i set this block in my custom module


texts:
I need to detect whenever the inventory level of a product changes. I've had some success using the cataloginventory_stock_item_save_after event which is triggered when inventory is changed in the backend, or when an order is cancelled on the frontend (via Paypal), but is not triggered when a product is purchased from the frontend.

I'm hooking into the cataloginventory_stock_item_save_after event like this:

<global>
    <events>
        <cataloginventory_stock_item_save_after>
            <observers>
                <cataloginventory_stock_item_save_after_handler>
                    <type>model</type>
                    <class>stockchange/observer</class>
                    <method>stockChange</method>
                </cataloginventory_stock_item_save_after_handler>
            </observers>
        </cataloginventory_stock_item_save_after>
    </events>

<?php
class FashionBunker_StockChange_Model_Observer {
    public function stockChange(Varien_Event_Observer $observer) {

Do I need to use another event to capture the inventory change when a customer purchases something, or is there something wrong with the way I've hooked into the event?


texts: Magento 2.2.5 Wysiwyg editor Error : Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded

texts:
In my custom module, I integrate Wysiwyg editor to admin form and it is working fine. but when I insert the external image path to the editor then it will show below error.

  error: error in [unknown object].fireEvent(): event name: tinymceSetContent error message: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

But when I insert same image path to Product content then it will not be showing any error and be working fine. I don't understand what's going wrong.

Here is my code editor code.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $wysiwygConfig = $objectManager->create('Magento\Cms\Model\Wysiwyg\Config')->getConfig();
    $fieldset->addField(
        'about_uS',
        'editor',
        [
            'name' => 'about_uS',
            'label' => __('About US'),
            'title' => __('About US'),
            'wysiwyg' => true,
            'config' => $wysiwygConfig
        ]
    );

Edit:

When i place same image URL under Admin >> content >> pages also get same error.

Can anyone help me to solve out this problem?

Any help would be appreciated! Thanks.


texts: How to hide the Catalog Advanced Search in magento version 1.9

texts:
I am working on a Magento e-commerce site.
I need to disable the Catalog Advanced Search.
I checked with source code available in the stackexchange but its not working.


texts:
I have created a custom payment gateway module. Everything works fine, except canceling the order from the backend.

The error: The order(s) cannot be canceled

Any ideas?


texts: "The configuration parameter "componentType" is a required for "advanced_pricing_button" component."

texts:
I have a weird issue:

Whenever i try to edit a product i get a error screen and in the report it display:

  The configuration parameter "componentType" is a required for
  "advanced_pricing_button" component.

I tried to follow the steps listed here: The configuration parameter "componentType" is a required for "advanced_pricing_button" component. | Upgrade Magento 2.0.7 => 2.1.0

But now only the words advanced_pricing_button are gone from the error report and it's still failing over the same element as I dumped the data element it's failing over.

"The configuration parameter "componentType" is a required for "" component."

Any thoughts ?

Here is the throw it's getting into:

if (!$isMerged) {
            if (!isset($data['arguments']['data']['config']['componentType'])) {
                throw new LocalizedException(new Phrase(
                    '<pre>'.print_r($data).'</pre>',
                    'The configuration parameter "componentType" is a required for "%1" component.',
                    [$name]
                ));
            }

And this is the print_r of the $data element.
As you see the throw is based on

!isset($data['arguments']['data']['config']['componentType']

however that is set in the element so the throw should never be made.

Array (
            [advanced_pricing_button] => Array (
                [arguments] => Array (
                    [data] => Array (
                        [config] => Array (
                            [displayAsLink] => 1
                            [formElement] => container
                            [componentType] => container
                            [component] => Magento_Ui/js/form/components/button
                            [template] => ui/form/components/button/container
                            [actions] => Array (
                                [0] => Array (
                                    [targetName] => product_form.product_form.advanced_pricing_modal
                                    [actionName] => toggleModal
                                )
                            )
                            [title] => Magento\Framework\Phrase Object (
                                [text:Magento\Framework\Phrase:private] => Advanced Pricing
                                [arguments:Magento\Framework\Phrase:private] => Array ( )
                            )
                            [additionalForGroup] => 1
                            [provider] => [source] => product_details
                            [sortOrder] => 121
                        )
                    )
                )
            )
        )


texts: How to increase/decrease items quantity of product in cart using REST API in magento 2?


texts: How to create a dropdown list in a form of registration for customer magento 2

texts: I want to create a new attribute named status as a dropdown list that contain 6  static values.


texts: "Invalid value for 'attribute'" (of type Yes/No) when creating product programmatically

texts:
When creating a product programmatically using the method described here, what format does the value need to be in for a Yes/No attribute type? (note: my attribute is global)

So far I have tried the following values for my Yes/No field:
0 and 1
1 and 2
'0' and '1'
'1' and '2'

So far all I am getting is the error "Invalid value for 'myAttributeName'"

I have scoured Google but somehow can't find an example of someone creating a product in this way where a Yes/No type attribute was used.

Note: I will test other values such as true false, 'Yes' 'No', and -1 0 and update question shortly.


texts: Magento 2.3.4 - infinite loop on checkout buttons

texts:
Fresh 2.3.3 install with 2.3.4 composer upgrade.

If I try clicking Paypal or Stripe checkout (default magento 2 checkout) I get this error.

INTERNAL ERROR. DETAILS ARE AVAILABLE IN MAGENTO LOG FILE. REPORT ID: WEBAPI-5E3EBD55C7D77

LOG FILE SHOWS:

[2020-02-08 13:11:36] main.CRITICAL: Report ID: webapi-5e3eb38834d5a; Message: Infinite loop detected, review the trace for the looping path {"exception":"[object] (Exception(code: 0): Report ID: webapi-5e3eb38834d5a; Message: Infinite loop detected, review the trace for the looping path at
/vendor/magento/framework/Webapi/ErrorProcessor.php:208, LogicException(code: 0): Infinite loop detected, review the trace for the looping path at /vendor/magento/module-checkout/Model/Session.php:241)"} []

Anyone able to shed some light on this? stupidly I made it live - so I have a live broken website.

Thanks!


texts: How can I add block through XML layout file, and not programmatically, through controller?

texts:
How can I add a block through XML layout file, and not programaticaly, through controller?

I have my block and I want to use it in a template that already exists (catalog/category/view.phtml).

How can I do this without going in and changing a controller, and without changing the catalog/category/view.phtml directly?

I want to add this block somewhere in an already existing template through XML, and not programatically.

This is part of my block:

class Mynamespace_Mymodule_Block_Myblock extends Mage_Core_Block_Template
{
    public function _construct()
    {
        $this -> setTemplate("mynamespace_mymodule/myblock.phtml");
        return parent::_construct();

    }

    public function getItemsByCategoryAndUseState($category, $use_state) {
        return "some used or new items";
    }
}

This is config.xml of my module:

<config>
<modules>
    <Mynamespace_Mymodule>
        <version>3.0.0.1</version>
    </Mynamespace_Mymodule>
</modules>
<global>
    <blocks>
        <mynamespace_mymodule>
            <class>Mynamespace_Mymodule_Block</class>
        </mynamespace_mymodule>
    </blocks>
</global>
<frontend>
    <layout>
        <updates>
            <mynamespace_mymodule>
                <file>mynamespace_mymodule.xml</file>
            </mynamespace_mymodule>
        </updates>
    </layout>

</frontend>

This is my package/theme/layout/mynamespace_mymodule.xml:

<layout version="0.1.0">
    <catalog_category_view>
        <reference name="product_list">
            <block type="mynamespace_mymodule/myblock" name="myblock" after="-" />
        </reference>
    </catalog_category_view>
</layout>

Thanks.


texts:
I'm totaly stuck on the tax calculation (-bug?).

In Magento my Products are excluded taxes and the calculation is based on the total. So included taxes my Product has a price , let's say 15.
My taxrate is 19%

So excluding taxes I have 15 / 1,19 = 12.6050.
Since Magento is rounding these prices I added a price (excl Tax) of 12.61 to the Product.
When calculating the taxes this results in 15.01 because of the rounding thing.
When using 12.60  I still have the issue because the result is 14,99.

From what I can the the priceCurrency method already performs a round($price, 4) which should work. As far I figured out this was an issue in Magento 1.x.

How can I get 15€ including Tax, with a taxrate of 19%?

Same goes for a price like 45€. and it gets even more frustrating when a product is bought in a greater quantity


texts: Discount price applied but not deducting from TAX summary

texts:
Sorry about my broken english as I am not a native english speaker.

I am update Magento 1.9 website from 1.8, finishing, discount price not subtracted from one page checkout page tax.

Discounts apply PayPal and other pages, there is no problem.

Grand Total Excluding Tax   416,67

TAX             33,33

Grand Total Including Tax   450,00

Subtotal            450,00

Discount (discount35)       -157,50


texts: Magento 2: How to add a condition to product list in backend?

texts:
Magento version: 2.0
In backend, I plan to add a new condition from a custom table to the product list and then get a new list of product.
how to do it?


texts:
I want to know if strangers have accessed the database.

If so, I want to find out how they got access to the database.

I found a strange trigger in the database (screenshot below).


texts: How to reroute simple products to associated configurable products - Magento 2.2.5

texts:
I have set up a Magento website where simple products are shown in the category listings and the configurable products for these items are in a hidden category. I need to add some functionality so when a customer clicks on 1 of these simple products it redirects them to the associated configurable product.

I tried making an extension as found in this link but it didn't work: How to redirect simple products to configurable product URL with options preselected in Magento 2.1

Then I tried the suggestion on this link: Redirect from simple product to parent product

This worked but it caused a bug where the images and choices wouldn't load on the configurable product page until the customer refreshed.

Does anyone know how to do this properly? Optimally I want the customer to be rerouted directly to the configurable product with no errors or bugs. Maybe this can be done by changing the links in the category product list?

Website Specs:
- Magento 2.2.5
- PHP 7.0.30
- MYSQL 10.0.34-MariaDB


texts:
I am customizing Magento's native one page checkout (ee 1.13). We have been modifying it so that customers could order without authentication (but without guests orders).
I'm having an issue with quotes. The flow of my checkout is :

Billing
Shipping
Shipping Method
Payment
Order Review

The whole flow works well except for one case. If the customer enters his email, goes to the second step, then goes back to the first step and changes his email, the quote is flushed and the shopping cart is empty. Please note that it bugs only when the second mail entered already exists on the DB (so, in a case we would have to force the authentication).

I've been debugging from index.php and I have no clue on which request could empty the cart.

Any clue that could help me ?

Cheers


texts: Sometimes Magento Admin will stop working. It just tries and tries to connect. If I load it up in a new browser it works again immediately. This is happening in different browsers (I mainly use chrome). Even if I close the tab, and try and load it again in a new tab it doesn't work. As soon as I load up "incognito mode" it works. This happens so often that it's really annoying. Any ideas?


texts: Magento 2.3.2. Restyling 'As low as' on category page. Which PHTML?

texts:
I have no configurable products, but tiered pricing. I would like to change the 'As low as £x.xx' on the category page to 'As low as £x.xx for 4+' as well as moving this to a new line below the regular price. I can sort out the HTML and CSS fine, but which PHTML file do I need to edit?
I have tried the final_price.phtml in my theme, and the Magneto core but nothing is changing. Is there another one hiding somewhere else?
Any help would be appreciated.


texts: Beginner—use custom *.phtml for each page

texts:
I am quiet new to magento and I about to code a custom template for a client. I would like to use one custom global main template file. By this I mean a template file that includes the:

<!DOCTYPE html>
<html>
    …
</html>

stuff. Due to this article I started by creating a app/design/frontent/<my_template>/layout/local.xml what is working nicely. But I also would like to override the »main entry point« of the template, which means: Starting at the <!DOCTYPE html>.

In other words what I would like to do is something like this (in local.xml):

<layout>
    <default>
        <reference name="root">
            <action method="setTemplate">
                <template><my_template>.phtml</template>
            </action>
            <action method="setIsHandle">
                <applied>1</applied>
            </action>
        </reference>
   </default>
</layout>

where <my_template>.phtml is located in app/design/frontend/<my_template>/template/. But is does not work and how can I get that working?

Thanks in ahead!


texts: Non http pages are redirecting to home page (Nginx)

texts:
I would like all my pages for http to redirect to the same location as https

for example

http://www.domain.com/somepage/ now redirects to https://www.domain.com

I would like it to redirect to https://www.domain.com/somepage/

When I applied the rule

return         301 https://$server_name$request_uri;

EDIT:

Adding the header of file

#enter preformatted text here`rackspacedigital.com

    server {

        listen 80;
        listen 443 ssl;

Do I need to separate out the listen to two server blocks?


texts:
I have a Magento based website.
In my product page I need to show related categories regarding the category the product fall into.

For example suppose the category structure
A- has three child categories B,C and D. Where C has a product than on this product page i need to show B and D as a related category.

Is there is any way to achieve this.

Thanks in advance.


texts:
I am wanting to run a special offer on a group of products where if they buy 4 they get a 5th free, OR if they buy 7 they get two additional free i.e. 4+1 (total of 5+ in basket) OR 7+2 (total of 9+ in the basket).
I have two issues - I can not work out how to run a 7+2, also I would need the 7+2 to superseed the 4+1, i.e the customer doesn't get the 4+1 and the 7+2

Thanks

These are the current settings...


texts: identify cash on delivery is availble or not using zip/postal code check on product view page

texts:
I want to add a textfield on "Product- view - page"

so that by entering zip/postal code, customer can check whether "cash on delivery " option is available

in their address or not.

I have some 500 zip/pin codes that support cash on delivery.

you can see demo example in the image.

please help me to find solution.

thanks in advance!


texts: Add Input Validation to Product Attribute with MySQL Install Script

texts:
I have a shipping plugin that creates 3 product attributes, namely length, width and height.

I have the following code in my install script:

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->addAttribute('catalog_product', 'length', array(
    'group'         => 'General',
    'input'         => 'text',
    'type'          => 'text',
    'label'         => 'Length',
    'backend'       => '',
    'visible'       => TRUE,
    'required'      => TRUE,
    'user_defined'  => TRUE,
    'searchable'    => FALSE,
    'filterable'    => FALSE,
    'comparable'    => FALSE,
    'visible_on_front' => FALSE,
    'visible_in_advanced_search'  => FALSE,
    'is_html_allowed_on_front' => FALSE,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

I wish add "Decimal Number" "Input Validation for Store Owner".

I tried changing type to 'int', but that didn't seem to work.

Using Magento Version 1.7.0.2. Here is the project on github and here is the Install File

Any help would be appreciated!


texts:
I want to remove products that are Out of Stock and we will will never receive it back in stock ever again. What is the best way to approach this? Some questions I have are;

1.)Should I delete the product from Magento all together?
      -Is a 301 redirect needed if I do this?

2.) Should I disable the product and set as 'Not Visible Individually', leaving it there forever? This can cause some clutter when analyzing stock situations. Isn't this the same as deleting it?

Any help is greatly appreciated.

Thanks.


texts: ->order('v.entity_id IS NULL') gets translated incorrectly

texts:
Zend_Db_Select::order is translating ->order('v.entity_id IS NULL') incorrectly to `v`.`entity_id IS NULL` ASC. It thinks "entity_id NULL" is the column name.

Any idea so I get the following?

ORDER BY `v`.`entity_id` IS NULL


texts:
I need to get the 'scope' value from core_config_data table of the current scope that has been selected by the user in the admin-panel. I've tried several methods posted in this site without success, for example:

Mage::app()->getWebsite()->getConfig('.../.../...')  Returns bool(false)

Mage_Core_Model_Website::getConfig() Returns the same...

I've also tried to get some random 'scope_id' and then get its 'scope' value, but this doesn't work since the same 'scope_id' value can be used for different 'scope' values and can't get the current scope value that i need.

Is there a way i can get the 'scope' value of the current scope selected by the user?.

Thanks


texts: How to change php for navigation Magento? Recursive method

texts:
I need to get a sub-category for category ID 3. Recursive method. How to do it correctly? I have this code.

<?php
$rootcatId= Mage::app()->getStore()->getRootCategoryId();
$categories = Mage::getModel('catalog/category')->getCategories($rootcatId);
function  get_categories($categories) {
  $array= '
';
    foreach($categories as $category) {
        $cat = Mage::getModel('catalog/category')->load($category->getId());
        $count = $cat->getProductCount();
        $array .= '
'.
        'getUrlPath()). '">' .
                  $category->getName() . "(".$count.")\n";
        if($category->hasChildren()) {
            $children = Mage::getModel('catalog/category')->getCategories($category->getId());
             $array .=  get_categories($children);
            }
         $array .= '
';
    }
    return  $array . '
';
}
echo  get_categories($categories); ?>


texts:
I would like to produce a report in Magento that tells me which products customers are using the notify me feature on.
The report might contain something along the lines of SKU and numer of people who have clicked notify me on that item, and maybe the most recent date occurrance?

Thinking out load there - but you get the idea. Is there anything already in existence, and if not, does anyone know how I might go about building such a report?

Cheers!


texts:
Because of French law (CNIL), I have to protect the customer from being traced by their IP. So, where are stored the customer's IP and how to anonymize them (replacing the last 2 Bytes by 0) ?

sales_flat_order.remote_ip
poll_vote.ip_address
any other location linkin a customer to his IP

I could do it in a sql script run in cronjob, but the IP addess must never be fully written in the first place.

Did anyone worked on this so far? not looking for code, but for advices.

Maybe an obscure Magento parameter magically totally disable the IP storing? Or should I make a custom module?

Addendum:
I know that implies to work with third party (Systempay, paypal, analytics), but I would like to not spread this topic in too many directions)

Thanks by advance.


texts: Store is not found+Data Migrating From M1.8.1.0 To M2.2.4

texts:
Step 1:- php bin/magento migrate:settings --auto vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.8.1.0/config.xml

It's working fine for me.

Step2:-  php bin/magento migrate:data --reset vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.8.1.0/config.xml

Getting " [Magento\Framework\Exception\NoSuchEntityException] Requested store is not found" error.

Note:-

1- Magento1 site has 2 stores, English & French.

2- Before starting Migration I've already added some categories, both of stores (English,French),CMS pages,static blocks etc manually On Magento2 site.

3- By data migration :-

I only needed product with attributes,orders, customer data so is this possible?

So please help me to either resolve issue OR any alternative of Note3.


texts: How to manage CSS performance in Magento 2?

texts:
I have a performance question about css and themes in Mangeto 2.

Is is better for performance write the specific css for some page like homepage in a separated file, and only load that file in homepage?

or it is the same if i put all the css in one place like magento base came.


texts:
I am trying to make a module with some settings I can change via system configuration

they explained me here:
How to make some parameters editable via admin

However I am having the following problem

Fatal error: Class 'Mage_Affiliate_Helper_Data' not found in /home/theprint/public_html/preprod/app/Mage.php on line 547

The structure is as follows:

Should I create a data.php empty?

http://screencast.com/t/mOnMlNKun

Update 1:

this is my config.xml

  <?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Luisvalencia_Affiliate>
            <version>0.0.1</version>
        </Luisvalencia_Affiliate>
    </modules>
    <global>
        <models>
            <luisvalencia_affiliate>
                <class>Luisvalencia_Affiliate_Model</class>
            </luisvalencia_affiliate>
        </models>
        <helpers>
            <luisvalencia_affiliate>
                <class>Luisvalencia_Affiliate_Helper</class>
            </luisvalencia_affiliate>
        </helpers>
    </global>
    <frontend>
        <events>
            <controller_action_predispatch>
                <observers>
                    <luisvalencia_affiliate>
                        <class>luisvalencia_affiliate/observer</class>
                        <method>captureReferral</method>
                        <type>singleton</type>
                    </luisvalencia_affiliate>
                </observers>
            </controller_action_predispatch>
        </events>
    </frontend>
</config>


texts: Get product or page name inside the parent template?

texts:
I'm integrating a custom html inside Magento and in the layout I have the h1 (title) before the main container. So, I need to get every every title in the 1column.phtml template page. How to get the product data or a CMS page title from the page 1column.phtml or 2columns-right.phtml for example?

I tried to do the following:

<?php if(Mage::app()->getFrontController()->getRequest()->getControllerName() == 'product') : ?>

<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

<?php endif; ?>

...and I got this error:

Fatal error: Call to a member function getName() on a non-object

Any help?


texts: PayPal: Configure your firewall settings before October 2017

texts:
I received this email from PayPal:
As part of our on-going commitment to provide a more robust service, Payflow will be introducing additional IP addresses to both the production and pilot environments. To minimize potential impact, we recommend that you use Domain Name Service (DNS) host names instead of hard-coding Payflow IP addresses.
However, if you must allow particular IP addresses through your firewall or proxy servers, please review our list of Payflow IP addresses to ensure that the appropriate IPs are configured in your firewall/proxy settings before mid-October 2017.
How to verify PayPal configuration in my magento 1.9?
Thank you,


texts: Spam customer registrations, CAPTCHA not stopping it, Max field rule being bypassed

texts:
Over the last few days we have been getting spam customer registrations,  every 90mins about 20 "accounts" are created in a few mins, with the first name being eg Рассадина Зинаида Пантелеймоновна, мы определили победителей совместного конкурса с помощью Google и Random.Org: https://www.google.com/#btnI=RandomOrg-%32&q=b%54%63%320%31%38rU

Its seems the idea is to spam using our welcome email with the link in the first name field going to a targets email ( we got a reported spam warning from hotmail)

We already have  captcha running as suggested in this answer:
https://stackoverflow.com/questions/47144150/preventing-spam-direct-post-request-customer-registrations-in-magento

and we have changed the maxlength on the create account page for the first and second name from 255 to 50 thinking at least we can stop the there goal of posting the long url link in the first name. But that is being bypassed and they are still able to post first names with 200+ characters.

Is there a way to enforce the 50 character limit?


texts: Magento 2.3.1 MFTF command error Permissin denied

texts:
I am working on the MFTF concept in Magento 2.3 community version.
 I am trying to run commands like vendor/bin/mftf --version and vendor/bin/mftf build:project, but getting error every time as:

  -" -bash: vendor/bin/mftf: Permission denied "

In vendor/bin I am trying to run command mftf --version . but it is also showing no command 'mtft' found.

Please provide a solution.  What I am doing wrong?


texts:
We're unable to change or add categories in the Magento 1 (1.9.2.2) backend. Upon clicking the 'Save category' button I get the following error in my console:

I've traced it back to the follwing code snippet that's located in app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml.
// Get info about what we're submitting - to properly update tree nodes
    var categoryId = params['general[id]'] ? params['general[id]'] : 0;
    var isCreating = categoryId == 0; // Separate variable is needed because '0' in javascript converts to TRUE
    var path = params['general[path]'].split('/');
    var parentId = path.pop();
    if (parentId == categoryId) { // Maybe path includes category id itself
        parentId = path.pop();
    }

The params['general[path'] is empty so the .split() function cannot fire.
Upon inspection of the backend form that creates or changes a category I've found out that general[path] is missing in the code. I've compared this to another Mangento 1 installation. This is the element that's loading on a 'healthy' Magento 1 installation:

I can't seem to find out what goes wrong. This causes a serious problem because we need to be able to alter categories for SEO reasons and to push new products.


texts: Magento 2: Create two packages for one product

texts:
I need your help.

A customer ordered exactly one product.
The product will be disassembled due to its size and shipped in two separate packages. Unfortunately, I cannot create two Magento packages for only one ordered product.
Is it possible to create packages without adding a product? It should also be noted that the products do not have a stock management system.

Greetings

Julius


texts: Override recently viewed widget in magento 2

texts:
I have added a recently viewed widget in home page

I want to remove add to cart button in the recently viewed widget.


texts: Magento2 jQuery.live is not a function on checkout page

texts:
When i am going to place an order on checkout page then on page load i am getting an error in firebug like jQuery.live is not a function on checkout page but not display always it shows sometime.

Please check the attached screen shot :

Please suggest about this.


texts: I want to get customer_id, name and email of logged in customer in product view. How to do it?


texts: Magento2: I am getting placeholder images in cron tab. Need to get correct images in cron

texts:
I am getting placeholder images in crontab.

Like this:
/pub/static/version1554967977/crontab/_view/en_US/Magento_Catalog/images/product/placeholder/.jpg;
This is wrong image.

How to get product image in cron tab?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $objectManager->get('Magento\Catalog\Model\Product')->load($item->getProductId());
                $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');
                $image_url = $imageHelper->init($_product, 'product_page_image_small')->setImageFile($_product->getFile())->resize(500, 500)->getUrl();


texts: Overriding Magento CartController not working

texts:
I am trying to override Magento Core CartController, But the core CartController is loading
config.xml (inside community/Company/BnOverride/etc/)

<?xml version="1.0"?>
<config>
    <modules>
        <Company_BnOverride>
            <version>0.1.0</version>
        </Company_BnOverride>
    </modules>
    <frontend>
        <routers>
          <checkout>
                <args>
                    <modules>
                        <company_bnoverride before="Mage_Checkout">Company_BnOverride</company_bnoverride>
                    </modules>
                </args>
           </checkout>
        </routers>
    </frontend>
</config>

CartController.php inside (community/Company/BnOverride/controllers/)

<?php
require_once 'Mage/Checkout/controllers/CartController.php';
class Company_BnOverride_CartController extends Mage_Checkout_CartController
{
    /**
     * Shopping cart display action
     */
    public function indexAction()
    {

        echo "Cart page";
        exit;
 }

And Company_BnOverride.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Company_BnOverride>
            <active>true</active>
            <codePool>community</codePool>
        </Company_BnOverride>
    </modules>
</config>


texts: Ubuntu Testing Magento 2 Emails Using Mailhog

texts:
I need an easy to use email tester, for Windows I use SMTP4dev which is really good. Mailhog seems to be the equivalent in Ubuntu/Linux.

I downloaded Mailhog, installed Go, and ran it with ./MailHog_linux_amd64 and it is running: http://http://0.0.0.0:8025/ the thing is though it is not getting the emails that Magento 2 is sending.

I tested with a new order email and also a reset password email, and also ran the php bin/magento cron:run to make sure the email is not stuck in the queue. How do you configure Magento 2 with Mailhog?


texts: Anybody try to use something instead compass for compiling sass in rwd theme? Compass is painfully slow!


texts:
0System Backup Excluding Media & Upgrade Takes Too Long and Installation Wizard Pops Up

So I started the upgrades from current 1.9.1.0 to 1.9.3.4 and checked system backup and maintenance mode check-boxes. 500 Error fixed with changing permissions to 755. Installation Wizard popped up on my domain After I fixed 500 Error. Back up is still in process.

Screenshot is attached


texts:
i want in details product page display with  $_product->getPrice()   and $_product->getSpecialPrice(), also the percentage by which the price has been changed, how i can display this percentage  in page?

Thanks


texts:
I've got the grid in a form but it's in the middle and doesn't take all space forem. How can I do it?

<?php
class Ns_Thorleif_Block_Adminhtml_Commerciaux_Edit_Form_Renderer_Fieldset_Grid extends Varien_Data_Form_Element_Abstract{
    protected $_element;

    public function getElementHtml()
    {
        return Mage::helper('core')->getLayout()->createBlock('thorleif/adminhtml_commerciaux_grid')->toHtml();
    }
}

My grid

and how I want to implement it

.

Adminhtml/Commerciaux.php

class Ns_Thorleif_Block_Adminhtml_Commerciaux extends Mage_Adminhtml_Block_Widget_Grid_Container
{
 //file del Header
   public function __construct()
    {
        $this->_controller = 'adminhtml_commerciaux'; // Répertoire où est le block Grid
        $this->_blockGroup = 'thorleif'; // Alias de nos blocks dans config.xml
        $this->_headerText = 'SyncManager';
        // On peut aussi changer le libellé du bouton "Add new" en changeant la propriété _addButtonLabel
        parent::__construct();
    }

    public function getHeaderCssClass() {
       return 'icon-head head-customer-groups';
    }

}

This is the part form.php

// section three
    $fieldset = $form->addFieldset('commerciaux_form_3', array('legend' => 'Category'));
    $fieldset->addType('category_grid', 'Ns_Thorleif_Block_Adminhtml_Commerciaux_Edit_Form_Renderer_Fieldset_Grid');
    $fieldset->addField('category', 'category_grid', array(
        'class' => 'required-entry',
        'required' => true,
        'name' => 'category',
        'onclick' => "",
        'onchange' => "",
        'disabled' => false,
        'readonly' => false,
        'tabindex' => 1,
        'width' => '100%'
    ));


texts: Magento 2 – How to off the autocomplete on forms on the admin


texts:
I want to remove an attribute from its attribute set, programmatically.
I have this code:

Mage::getModel('catalog/product_attribute_set_api')
    ->attributeRemove($attributeId, $attributeSetId);

I want this code to be run only one time. Where should I put it? It seems I can't put it in a SQL upgrade file.