texts:
Could someone possibly explain the structure and what files are for in a CRUD module? I have created by module by following a guide online, and its working great and printing out my database fields on the page, but i'm a bit confused as to what some of the files do?

Here are my files so far and what i've gathered they do

Vendor/Module/Api/Data/PostInterface.php

I have no idea what the interface file does, some guides have it and some do not and I can't seem to make sense of it.

Vendor/Module/Block/PostList.php

The block file that connects directly to my template files for rendering data in the templates and layout.

Vendor/Module/Controller/Index/Index.php

The index file that renders the template for the requested page?

Vendor/Module/etc/frontend/routes.xml

The xml file that specifies the routes for the url.

Vendor/Module/etc/module.xml

The module declaration xml file.

Vendor/Module/Model/ResourceModel/PostModel/Collection.php

I think this file is the one that connects to the database?

Vendor/Module/Model/ResourceModel/PostModel.php

I have no idea what the resource model does.

Vendor/Module/Model/PostModel.php

Our actual model file.

Vendor/Module/Setup/InstallSchema.php

The file that installs the database tables.

Vendor/Module/view/frontend/layout/postmodel_index_index.xml

The index layout file.

Vendor/Module/view/frontend/templates/list.phtml

The template file that we connect to our block to load data.

I'm fairly new to magento 2, and I haven't used magento 1 before. I think I have a basic understanding of what all the files do, but if someone could briefly explain exactly what each of the files are for, i'd be very grateful!

Thanks in advance


texts:
I need to remove email address field from registration and want to use only mobile number field. Which template i need to override ?

please suggest how can it possible ?


texts: Magento 2 : Label not display after add field with custom type

texts:
In admin form, I created custom field type and then, add html content by custom phtml file.

But, after that label not display with custom field type.

Custom Field Type :

$fieldset->addType(
    'custom_field_labels',
    '\Vendor\Magento\Block\Adminhtml\Module\Edit\Renderer\CustomField'
);

$fieldset->addField(
    'custom_text',
    'custom_field_labels',
    [
        'name' => 'custom_text',
        'label' => __('Custom Text'),
        'title' => __('Custom Text'),
    ]
);

  Vendor\Magento\Block\Adminhtml\Module\Edit\Renderer\CustomField.php

<?php

namespace Vendor\Magento\Block\Adminhtml\Module\Edit\Renderer;

class CustomField extends \Magento\Framework\Data\Form\Element\AbstractElement {

    protected $_blockFactory;

    public function __construct(
        \Magento\Framework\View\Element\BlockFactory $_blockFactory
    ) {
        $this->_blockFactory = $_blockFactory;
    }

    /**
     * Get the after element html.
     *
     * @return mixed
     */
    public function getElementHtml() {
        $customDiv = $this->_blockFactory
            ->createBlock('Vendor\Magento\Block\Adminhtml\Module\Edit\Tabs\MyTab')
            ->setTemplate('Vendor_Magento::product/tabs/mytabs.phtml')->toHtml();
        return $customDiv;
    }
}

How can I solve that issue?

Any help would be appreciated.


texts: Magento2: Failed Override Magento_Tax module Class with protected method

texts:
I am trying to override class Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector
I tried everything and checked the implementation is correct in di.xml
The method I am trying to override is a protected method processProductItems()
I have no clue what am I doing wrong here. It keeps calling the function from the original Magento_Tax class
di.xml
<?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\Tax\Model\Sales\Total\Quote\CommonTaxCollector"
        type="Folio3\TaxCollector\Model\Sales\Total\Quote\CommonTaxCollector"/>
</config>

Override class Folio3\TaxCollector\Model\Sales\Total\Quote\CommonTaxCollector.php
class CommonTaxCollector extends \Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector
{
...

module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Folio3_TaxCollector" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
            <module name="Magento_Checkout"/>
            <module name="Magento_Customer"/>
            <module name="Magento_Directory"/>
            <module name="Magento_User"/>
            <module name="Magento_Tax" />
        </sequence>
    </module>
</config>

Can anyone explain to me what am I doing wrong here? I think I have followed all the necessary steps. It keeps calling the original CommonTaxCollector.php class from Magento_Tax module


texts:
Pulling my hair out here trying to troubleshoot the reason why some new products aren't displaying on the frontend. I've checked the usual stock, weight, visibility, etc and have reindexed and recached plenty of times.

Can anyone think of anything else that could be causing this?

(Also, these products are counted in the result counts for searches, but not actually shown)

Update: products can be accessed directly via their URL/ID, but they aren't showing up in the categories/search results.


texts: How I can add a static block on product description page after fotorama end?

texts:
I want to add a block and put pictures in it to show on product description page .

Every page will have different pictures. How can I add this block ?  As on other pages I can add using admin but for product description page how I can ?
EDIT
image after adding attribute.

EDIT2
drag and drop of attributes

Detail.phtml

<?php
// @codingStandardsIgnoreFile
?>
<?php
    $theme = $this->helper('Infortis\Base\Helper\Data');

    $showTabs = $theme->getCfg('product_page/tabs'); //$block->getData('show_tabs');
    //$mode = $theme->getCfg('product_page/tabs_mode');
    //$threshold = intval($theme->getCfg('product_page/tabs_threshold'));
    //$initCollapsed = $theme->getCfg('product_page/tabs_collapsed');
    //$reviewsInCollateral = $theme->getCfg('product_page/collateral_reviews');

    $containerClasses = '';
    $tabsClasses = '';
    if ($showTabs)
    {
        $containerClasses .= ' collateral-tabs';
        $tabsClasses .= ' ' . $theme->getCfg('product_page/tabs_style');
        // $tabsStyle = $theme->getCfg('product_page/tabs_style');
        // switch ($tabsStyle)
        // {
        //     case 'style-luma':
        //         $tabsClasses .= ' style-luma';
        //         break;
        //     case 'style1':
        //         $tabsClasses .= ' style1';
        //         break;
        //     case 'style1-small':
        //         $tabsClasses .= ' style1 style1-small';
        //         break;
        // }
    }
    else
    {
        $containerClasses .= ' collateral-stacked';
    }

?>
<?php if ($detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml')):?>
    <div class="product info detailed box-collateral<?php echo $containerClasses; ?>">
        <?php echo  $_product->getAddTextArea();?>
        <?php $layout = $block->getLayout(); ?>
        <div class="product data items<?php echo $tabsClasses; ?>" <?php if ($showTabs): ?>data-mage-init='{"tabs":{"openedState":"active"}}'<?php endif; ?>>
            <?php foreach ($detailedInfoGroup as $name):?>
                <?php
                    $html = $layout->renderElement($name);
                    if (!trim($html)) {
                        continue;
                    }
                    $alias = $layout->getElementAlias($name);
                    $label = $block->getChildData($alias, 'title');
                ?>
                <div class="data item title"
                     aria-labeledby="tab-label-<?php /* @escapeNotVerified */ echo $alias;?>-title"
                     data-role="collapsible" id="tab-label-<?php /* @escapeNotVerified */ echo $alias;?>">
                    <a class="data switch"
                       tabindex="-1"
                       data-toggle="switch"
                       href="#<?php /* @escapeNotVerified */ echo $alias; ?>"
                       id="tab-label-<?php /* @escapeNotVerified */ echo $alias;?>-title">
                        <?php /* @escapeNotVerified */ echo $label; ?>

                <div class="data item content" id="<?php /* @escapeNotVerified */ echo $alias; ?>" data-role="content">
                    <?php /* @escapeNotVerified */ echo $html; ?>

            <?php endforeach;?>

<?php endif; ?>

<button type="button" id="review_id">Write Review</button>


texts: Magento 2 get all products including out of stock ones

texts:
I have below code in an script outside Magento to get products. It's working fine except it doens't return out of stock products.

How can I add out of stock products to the collection?

// Only gets in stock products
public function getProductsInStock() {
    try {
        $productCollection = $this->objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');

        $collection = $productCollection->create()
            ->addAttributeToSelect('sku')
            ->addAttributeToSelect('price')
            ->load();
    } catch (\Exception $e) {
        echo $e->getMessage();
    }
    return $collection;
}

EDIT: I just did some testing. It seems it has to do with following option in backend: Display Out of Stock Products. When it is set to yes the code returns all products instead of just the in stock products.

Is it possible to ignore this setting in any way?


texts:
I have a html template with a string that's translated.
The translation contains a html a tag. but the tag is printed as text when rendered.
.html file content:

{{trans "footer_link_privacy"}}

en_US.csv content:
"footer_link_privacy", "Privacy Policy"


texts: Multi-select select option value issue Options

texts:
I have some problem with multi-select list in catalog/product/view.phtml

I've tried to echo only "selected" values but without result, this code outputs all values no matter what I choose from select-list.

The frontend Magento select list looks like this:

<select>
    <option selected="selected" value="17">230V</option>
    <option selected="selected" value="18">24VAC</option>
    <option value="20">24VAC/DC</option>
    <option value="19">24VDC</option>
</select>

Here is also my code from view.phtml file (product view):

function getSelectAttributeValues($attrCode)  {
    $attributeCode = $attrCode;

    // build and filter the product collection
    $products = Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToFilter($attributeCode, array('notnull' => true))
        ->addAttributeToFilter($attributeCode, array('neq' => ''))
        ->addAttributeToSelect($attributeCode);

    $usedAttributeValues = array_unique($products->getColumnValues($attributeCode));

    // fetch the attribute model
    $attributeModel = Mage::getSingleton('eav/config')->getAttribute('catalog_product', $attributeCode);

    // map the option id's to option labels
    $usedAttributeValues = $attributeModel->getSource()->getOptionText(
        implode(',', $usedAttributeValues)
    );

    if (is_array($usedAttributeValues)) {
        return implode(', ', $usedAttributeValues);
    } else {
        return $usedAttributeValues;
    }
}

Please help me, I'll be grateful for any advice.


texts: Magento 301 Redirection having multiple redirects Nginx Server

texts:
We have migrated a website from .NET platform to Magento. We have changed the URL structure of both the websites hence the old URL needs to be redirected to New URL.

For example:

1) Old URL: http://www.example.com/p-20912-nutrasec.aspx

2) New URL: https://www.example.com/nutrasec

Many of our old URL are HTTP which needs to be redirected to HTTPS. I have used Magento URL Custom Rewrite feature to perform redirection. The redirection performed is 301 permanent. Please check the screenshot below

Though redirection works but we are getting multiple redirection for it ie:

1) When user opens http://www.example.com/p-20912-nutrasec.aspx it is redirected [301] to http://www.example.com/nutrasec

2) And then again a second redirection is occured to https://www.example.com/nutrasec which is [302]

This is a huge problem. The configuration done in the admin are as below:

We are using nginx server. It seems to be a problem with Magento Redirection. Any help will be appreciated.


texts: Magento create duplicate site script in php

texts:
I am looking for a PHP script that can create a backup mirror of my store for development purposes. I have been looking around, but not found.

Reading this:
http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server#old_server

There must be a way or someone has done it to make a full site and DB copy?

For example: A all in one copy script - or something like modman that gabs all it needs and creates and second site


texts: Price filter not showing on layered navigation

texts: Price filter not working even I have also selected "Filterable (with results)" in price attribute


texts: Magento 1.9.2 Unknown cipher in list: TLSv1

texts:
Just tried to load an extension through magento connect and had the error "Unknown cipher in list: TLSv1", the extension was Subcategories Grid/List by apptrian.

Have tried a few more extensions and the same error comes up.  Magento 1.9.2

Anyone have a clue on how to approach this issue?


texts: Shopping cart with multiple shipping conditions, one is free

texts:
I am having a problem with free shipping conditions when my cart have more than one product and there is an other shipping condition ( not free)  for at last an other product.
Until there is only one product sold with free shipping conditions, everything works perfectly. free shipping option is shown at buyer end and for all others products, the free shipping option is not shown at buyer end ( free shipping is managed through atributes and cart rules).

When i have more than one product, Example: product X =free shipping and product Y =postmail paid shipping, both products are automatically considered as paid shipping. Only paid shipping option is shown at buyer end while Free shipping option is not shown, i suppose because cart rules are for the whole cart and not  for specific items.  Anyone to give me an advice to solve this?


texts:
How to get magento 2 api get category brand value (multiselect)

here:


texts: How can I apply error reporting in Magento 2?

texts: I googled out how to apply error reporting in Magento 2, but I didn't find any solution yet. It will be useful if there is any link.


texts: Position to be increased automatically in Position Column in Catalog > Manage Categories > Category Products

texts:
In Catalog > Manage Categories > Category Products,  I want to randomly order Product position. It is fine for me to edit product position manually if total number of products for Specific category is up to 20 or 30. It is not ok for me if total no of products is 50+. From the side of marketing, sometimes, they want to order products randomly but not by product ID.

As a default in the Position Column of Category Products tab, all products position is set as 1. I don't want 1. What I want is when I add Product A under Category 1, I want its position to be 1. When I add Product B under the same category, I want its position to be 2. For the Product C, I want its position to be 3 and so so. Anyone can help me please? Thank you so much.


texts: how to create two different 404 page for my two module

texts:
i need two different 404 page for customer and vender.

i need different page for customer and different page for vender.

how can i do different page for customer and vender


texts: Magento 2.1.8 EE unable to update product attribute iin admin

texts:
I have a product attribute full_short_description created from admin panel. For already existing products, I am unable to update the attribute value. But if I create a new product, I can change the value and it is showing the change on frontend too.

For existing products if I change the value it is showing product saved successfully but in admin and frontend showing the old value only. The value is not even updating in database.
Reindexing is done.
Setup upgrade and cache flush also done.


texts: using the magento image uploader in custom module

texts:
I am trying to add the magento image uploader to my custom admin module. After tracking it down in the code base and getting very confused as to where and how it is all generated I searched on google and found this and this. My issue is the way I have followed these instruction I end up with a choose file button
what I am trying to achieve is

I was expecting this to be a straight forward below is what I have

class Namesapce_Module_Block_Adminhtml_ShopLocator_Edit_Tab_Media extends Mage_Adminhtml_Block_Widget_Form
{

protected function _prepareForm()
{
    $form = new Varien_Data_Form(array(
        'id'    => 'edit_form',
        'action'=>  $this->getUrl('*/*/save',
                                   array('id' => $this->getRequest()->getParam('id'))),
        'method'=> 'post',
        'enctype'   => 'multipart/form-data'
        )
    );

    $fieldset = $form->addFieldset('general_form', array(
                                   'legend' => $this->__('Add Media')
    ));

    $fieldset->addType('image', Mage::getConfig()->getBlockClassName('namespace_module/adminhtml_shoplocator_helper_image'));

    ...otherFields

    $fieldset->addField('image', 'image', array(
        'label'     => $this->__('Add New Image'),
        'required'  => false,
        'name'      => 'image[]',
        'multiple'  => 'multiple',
        'multiple'  => 'multiple'
    ));

    ...otherFields
 }

protected function _getFormData()
{
    $data = Mage::getSingleton('adminhtml/session')->getFormData();
    if (!$data && Mage::registry('current_shop')->getData()) {
        $data = Mage::registry('current_shop')->getData();
    }
    return (array) $data;
}

}

.

class Namespace_Module_Block_Adminhtml_ShopLocator_Helper_Image extends Varien_Data_Form_Element_Image
{
    public function getHtmlAttributes()
    {
        return array_merge(parent::getHtmlAttributes(), array('multiple'));
    }
}


texts: Items ordered edit not working but it was working before

texts:
Edit button is not working here... I dont know from where to start checking why its not working, any sugessions?
update: Edit button returns an error
error: "Could not receive Stock Item data"
another update
after debugging thinking that the problem is somewhere here
   getLoadFromData:function(){
            var orderId = this.getCurrentOrderId();
            return {'form_key':FORM_KEY, 'order_id':orderId};
        },


texts: Loading different related files with catalog_category_layered

texts:
I have created a custom template layout and it works fine, My page is named 2-col-custom.phtml I have written the following code in my layout page but it won't load.

 <page_two_col_custom>
         <reference name="head">
            <action method="addItem"><type>skin_css</type><stylesheet>css/col-custom.css</stylesheet></action>
            <action method="addItem"><type>skin_css</type><stylesheet>css/test.css</stylesheet></action>
        </reference>
    </page_two_col_custom>

How can I make catalog_category_default load a particular css with a custom template 2-col-custom.phtml and a copy of list.phtml with different layout ?


texts:
I'm having a lot of problems adding an html tag in head section only on homepage layout (that's defined in my custom theme as page layout). I'm using M2 v. 2.2

In default.xml is defined

<referenceBlock name="head.additional">
    <block class="Magento\Framework\View\Element\Template" name="head.additional.fonts" template="Infortis_Base::html/header/fonts.phtml" after="head.additional.asset-wrapper" />
</referenceBlock>

and I added a block to edit and insert an html tag:

<referenceBlock name="head.additional">
    <block class="Magento\Framework\View\Element\Template" name="head.additional.fonts" template="Infortis_Base::html/header/fonts.phtml" after="head.additional.asset-wrapper" />
    <block class="Magento\Framework\View\Element\Template" name="head.additional.metas" template="Infortis_Base::html/header/metas.phtml" before="head.additional.asset-wrapper" />
</referenceBlock>

so that I would be able to change the phtml template inside the home xml page layout but if I reference the block it doesn't change.

Any help? I'm on this from 2 days and it driving me crazy. THANKS


texts: Can I remove module info from Column "Extra" in Magento Admin_User Table?

texts:
I like my Magento database as clean as possible so whenever I uninstall an extension I also remove all data that was stored by this particular module from the database.

Now I noticed that there is some data stored in the extra column of the Admin_User Table too. It lists many old modules that I have removed in the past.

What is the purpose of this column and is it safe to remove the data that is related to exensions that are no longer installed?


texts: Magento 2: How to configure Nginx to use multiple websites with sub-folder

texts:
We would like to create multiple websites in Magento 2. There is an article about this topic in the Official Magento 2 Documentation, but the way they describe is not suitable for our case.

They are suggesting to use sub-domains in order to determine different websites, such as

website1.magento-site.com
website2.magento-site.com

We would like to use sub-folders instead of sub-domains. To give an example,

magento-site.com/website1
magento-site.com/website2

How can we overcome this issue on Nginx web server?

My Configuration

I am using Ubuntu 16.04. I have installed Nginx, and have not changed any Nginx core configuration. I have created a file magento-site.com.conf inside /etc/nginx/sites-enabled/magento-site.com.conf.

/etc/nginx/sites-enabled/magento-site.com.conf

server {
    listen 8080;
    server_name magento-site.com;

    set $MAGE_RUN_CODE website1;
    set $MAGE_ROOT /var/www/magento-site.com;
    include /var/www/magento-site.com/nginx.conf;
}

EDIT 1: (2017-10-23)

I have multiple stores for each website.


texts: Set Default Value to custom options for products

texts:
I am having custom options created for the products. I need to set some option as default for the custom option so that when user checks on the front end default option will be seen instead of "Please Select".

I found one Extension default state of custom option for simple products

But I am looking for if I can show at the place where I am creating the options.


texts: Magento 1: use of observers and missing native core setter?

texts:
Yet another best practice question.

So here's the thing, I have several modules that deal with setting different data on the core Magento block.

I don't like to rewrite entire blocks and I tend to use observers intead.

Here's an example:

The goal of the module is to set some rates for the following blocks:

Mage_Checkout_Block_Onepage_Shipping_Method_Available
Mage_Checkout_Block_Cart_Shipping

The easiest way of doing it would be to rewrite both blocks to add my logic in the getEstimateRates method but I don't really like that logic so here's what I've done:

Still rewritten the blocks

Just to add the following method that is missing from the original blocks:

public function setEstimateRates($rates)
{
    $this->_rates = $rates;
}

Use observers

Thanks to this new method, I can use an observer on core_layout_block_create_after to update the rates on the fly:

// Get the block
$block = $observer->getBlock();
// Get the OG block rates
$rates = $block->getEstimateRates();
if ()
{
unset($rates[self::$_KEY]);
}
// Set the new rates
$block->setEstimateRates($rates);

A second example of a similar problem I have faced a while ago can be found here: Category Product List : add a custom view mode via observer

So here are my questions:

is that bad practice to add methods to native classes, especially setters ?
is it better practice to do what I just did instead of rewriting a core class method ? pros/cons ?


texts: Magento 2.3 app folder is not reading by Magento

texts: I have installed Magento 2.3 EE in my local and after install we see that the app folder is not reading by Magento with php bin/magento s:up command. if any one face similar issue and resolved earlier.


texts: How to show a custom grid in a custom tab in product edit page admin Magento-2

texts:
How to add a custom grid in a new tab in product edit page using UI_Component method?

This custom grid fetches collection from a custom table.


texts: How to programmatically set a multiselect attribute value to a product in Magento 2?

texts:
I'm having trouble setting values to a multiselect type attribute for a product programatically.
Example attribute: material
Example values: cotton & polyester
Please note that both attribute and option values are created from the backend.
This is what I have tried so far:
$product = $objectManager->create('Magento\Catalog\Model\Product');
$sku = '1234';
$product_id = $product->getIdBySku($sku);
if ($product_id) {
    $product->load($product_id);
    $attribute_values = array('cotton','polyester');
    $product_resource = $product->getResource();
    $attribute_code = 'material';
    $attribute = $product_resource->getAttribute($attribute_code);
    if ($attribute->usesSource()) {
        foreach ($attribute_values as $attribute_value) {
            $attribute_option_ids[] = $attribute->getSource()->getOptionId($attribute_value);
        }
        $product->setData($attribute_code, $attribute_option_ids); // attempt 1
        //$product->setData($attribute_code, array($attribute_option_ids)); // attempt 2
        //$product->getResource()->saveAttribute($product, $attribute_code); // attempt 3 with combining attempt 1
    }
    $product->save();
}

The end result is that no values are set for the material attribute for product 1234.
Any ideas what I'm doing wrong?


texts: The string "Allproducts" isn't included in the URL Redirect in the pager

texts:
In CMS > Pages I've created an all products page. The content has this in it:

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="100" template="catalog/product/list.phtml"}}

An example URL: https://www.awebsite.com/allproducts

It works fine, every product is shown on the page as it should. But, I've a problem with the pager. When a user clicks on "show 80 products in page", then the problem appears. The user gets redirected to this url:

An example of the faulty URL: https://www.awebsite.com/?limit=80

As you can see, the all-products isn't included in the url. Thus, not redirected to the all products page.

I found this articles:

http://www.noamdesign.com/magento-include-toolbar-and-pagination-when-listing-products/
https://stackoverflow.com/questions/7555157/show-pagination-links-for-product-list-on-a-magento-cms-page

How can I fix this?


texts: Magento 1.9 Additinal info attribute with icon

texts:
Currently the additional information shows the names of the attributes and then the content, like the image for example:

I would like to have icons for some attributes to show, the icons should take the place of the attribute name.

for example: Country flag instead of the text "country of manufacture", so also for other attributes

Which file should I modify to make it happen?

Thanks


texts: Should I block access to the Internet Archive crawler? (Archive.org)

texts:
The internet archive is a fantastic resource, however, my magento shop is scanned by the crawler all the time.

Should I block the crawler?

Very often we don't want the previous products prices available for all time.


texts:
following on from the release of the SUPEE-6788 patch I was wondering what the advised process is for those modules which have not yet been patched or updated but are vital for customer interaction & site functionality.

On one of our client websites running: https://github.com/rhoerr/supee-6788-toolbox provides a sizeable list of modules which are not compatiable with the patch, however after updating a couple of them I have found that the module developers have not yet upgraded their modules.

In this case, what is the best practise, change the admin routing via the script and wait for the module developer to release an upgrade or completely remove the module/find an alternative?

Thanks


texts: Magento 2.1.1 SessionHandler::read(): Write of lock failed

texts:
I try to install Mage 2 to my Ubuntu, Apache2, PHP7, MySql.
First time a had error binded with not installed memcached. I have installed it. Then i have:

1 exception(s):
Exception #0 (Exception): Warning: SessionHandler::read(): Write of lock failed in /var/www/magento2.ubu/vendor/magento/framework/Session/SaveHandler/Native.php on line 22

May be someone has solution to this? Thanks


texts: Website switching in magento 1.9 without changing the default url

texts:
I have a website in Magento 1.9 called www.example.com. In Magento, we know that we can create multiple websites so I have created like that multiple websites with their own store and store view. so I have the site.

example.com(default)
example.com(2)
example.com(3)
example.com(4)

My requirement is I need to switch to these websites by staying the same URL (www.example.com). Can any one help me to do this?


texts:
In the default.phtml for the checkout cart this is used to get all options:

<?php if ($_options = $block->getOptionList()):?>

        <?php foreach ($_options as $_option) : ?>
           <?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>

<?php echo $block->escapeHtml($_option['label']) ?>

            <?php if (isset($_formatedOptionValue['full_view'])): ?>
                <?php /* @escapeNotVerified */ echo $_formatedOptionValue['full_view'] ?>
            <?php else: ?>
                <?php /* @escapeNotVerified */ echo $_formatedOptionValue['value'] ?>
            <?php endif; ?>

        <?php endforeach; ?>

<?php endif;?>

But how do I get one specific option with value and label by its code?

I added that option in the backend. There it is called attribute suddenly  for some reason. And there are also some functions to get attributes but neither of them returns anything other than null if I try to use it on the $product in default.phtml.
I also tried to fetch it in the same matter it is fetched in ->getOptionList() but that also returns nothing else than null.
Here are some things I tried in the head of default.phtml.

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var $block \Magento\Checkout\Block\Cart\Item\Renderer */

$_item = $block->getItem();
$product = $_item->getProduct();

$optionIds = $_item->getOptionByCode('option_ids'); // null
$addOptions = $_item->getOptionByCode('additional_options'); // null

$option = $product->getOptionById(140); // null
$customOption = $product->getCustomOption('mycode'); // null
$customAttribute = $product->getCustomAttribute('mycode'); // null
$customOptions = $product->getCustomOptions(); // does not contain it
$options = $product->getOptions(); // null
$data = $product->getData(); // doesn't contain it either

Trying to add more data hoping this might help someone spot where it is breaking...

Here is how the attribute is setup:

$eavSetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY,
    'mycode',
    [
        'type' => 'int',
        'backend' => '',
        'frontend' => '',
        'label' => 'My Code',
        'input' => 'select',
        'class' => '',
        'source' => '',
        'global' => 1,
        'visible' => true,
        'required' => false,
        'user_defined' => true,
        'default' => null,
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => true,
        'used_in_product_listing' => true,
        'unique' => false,
        'apply_to' => 'configurable',
        'system' => 1,
        'group' => 'General',
        'option' => array('values' => array("x","y"))
    ]
);


texts: SQL Query Newsletter subscription status with custom tables

texts:
I currently have the following script that someone else wrote for me that exports custom Magento data to a CSV file. It takes data from the two tables 'perfume_fragrance' & 'perfume_fragrance_blend' and adds it to the customer's email address.

I would like to add a further column to the CSV file that includes the customer's newsletter subscription status.

I've found the 'newsletter_subscriber' table which has the 'customer_id' and 'subscriber_status' but am not sure how to add it to the SQL query.

<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
date_default_timezone_set('Europe/London');

chdir(dirname($_SERVER['SCRIPT_FILENAME']));

$db = mysqli_connect("localhost", "removed", "removed", "removed");

$data = array();
$data[] = array('Email', 'Fragrance', 'Location', 'Date', 'Creator', 'Blend');

$sql = "SELECT CE.*, PF.fragrance_id, PF.fragrance_name, PF.created_at, PF.created_on, PF.created_by FROM customer_entity CE JOIN perfume_fragrance PF ON PF.customer_id = CE.entity_id AND PF.created_at = '- PA EVENT'";
$result = $db->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {

        $sql3 = "SELECT * FROM perfume_fragrance_blend WHERE fragrance_id = ".$row["fragrance_id"];
        $result3 = $db->query($sql3);
        if ($result3->num_rows > 0) {
            $blend_desc = '';
            $i = 1;
            while($row3 = $result3->fetch_assoc()) {
                $blend_desc .= $row3['blend_name'].' x '.$row3['blend_qty'];
                if($i < $result3->num_rows){ $blend_desc .= ', '; }
                $i++;
            }
            //echo "id: " . $row["entity_id"]. " - Email: " . $row["email"]. " - Fragrance: " . $row["fragrance_name"]. " - Location: " . $row["created_at"]. " - Date: " . $row["created_on"]. " - Creator: " . $row["created_by"]. " - Blend: " . $blend_desc."
";
            $data[] = array($row["email"], $row["fragrance_name"], $row["created_at"], $row["created_on"], $row["created_by"], $blend_desc);
        }

    }
}

echo "Beginning CSV Creation...
";

$fp = fopen('database.csv', 'w');

foreach ($data as $fields) {
    fputcsv($fp, $fields);
}

fclose($fp);

echo "Script Finished";


texts: How to get the stock quantity of the item and show it on a list.phtml page in Magento 2.2.3?

texts:
I have been trying to display the stock quantity of each item on the "list.phtml" page but not getting anywhere.

Please see the attached photos as an example; this is what I have been trying to achieve. If could someone gives me the step by step guide would be helpful.


texts: Difference between _toHtml() and getGroupedHtml() in templates

texts:
Newer versions of Magento are using _toHtml() instead getGroupedHtml() in the template files.

But Mage_Core_Block_Messages::_toHtml() always just returns $this->getGroupedHtml() - Also back in Magento CE 1.5.1

Can anyone point out why it got changed in newer versions? Thanks!


texts: Is it possible to include a parent local.xml?

texts:
I'm in the process of converting my company's web site to Magento 1.9. We've purchased a theme, but need to make some design changes such as adding javascript and css files to the header.

I'm new to Magento, but I believe that the changes we need to make would typically be made by modifying the local.xml file of the theme. My purchased theme, however, already has a very detailed local.xml. I'm hesitant to modify this because I assume it's likely to change if the theme is updated. I've tried overriding the layout under Config->Design->Themes->Layout, but when I create my own local.xml, of course the primary file is never loaded.

Is it possible for my overridden local.xml to indicate that the parent file should be ran as well? Or is there a better way to accomplish what I'm trying to do in general? I believe I could create a module that applies our layout changes, but that doesn't seem like the "right" way to do it.


texts:
Even though I've been working with Magento for some years now, the combination of
discount rules and tax rules has always been some kind of mathematical mystery. In
basic, there are 2 parameters:

Apply customer tax before or after the discount.
Apply discount rules on prices on prices including or excluding tax.

The combination of these parameters has always been of some interesting results, but
whenever the client asked me 'why?', I had the break my brain once more on what it
all exactly meant.

So that's why I decided to spent some time examining these rules and their combinations,
analyzing the results and in the end, I came up with this:

The Possible Combinations

Basicly there are 4 combinations possible:

Apply Customer Tax before discount, and apply discount on prices excluding tax.
Apply Customer Tax before discount, and apply discount on prices including tax.
Apply Customer Tax after discount, and apply discount on prices excluding tax.
Apply Customer Tax after discount, and apply discount on prices including tax.

There are also 2 kind of discounts to consider:

A discount with a fixed amount (10 EURO for example).
A discount with a percentual amount (10% for example).

This together makes room for 8 different combinations. I've recently wrote an article about this that might be a bit too long to copy/paste entirely in this question, but I'll share my conclusion here:

The Conclusion

So I tested all the above combinations and I (tried) to analyse their results. However, I could only come to the conclusion that you would only ever want to use the combination 'Apply Tax after discount / apply discount on prices including tax'. All other combination would result in 'weird' results: discount that is not the value that is expected, or a tax rate that does not makes much sense at first glance.

All these results made me wonder: 'Why all these settings when there is only one possible correct solution?'. Perhaps there are countries where the tax rules states that discounts may not be taxed?. Otherwise I
wouldn't know why you would ever any of those other combinations.

My Question

If you know (or have ever dealt with) a good use case why you would use any other combination of customer tax / discount rules than the one described above, could you please explain to me why? Because right now it seems like there's only one good setting which makes me wonder why it's configurable at all!


texts:
In magento1 we are able to set Post value like following

$this->getRequest()->setPost('super_attribute', null)

So how can we set post in magento2?


texts: Magento 1 - How to get credit memo / refunds without specifying a specific order?

texts:
Magento 1

I'm trying to get some of the latest refunds issued in magento by timestamp.
I want to be able to get them WITHOUT specifying any specific order.
How do I do this programmatically?


texts:
I have a huge problem with Magento on a live platform.
I've disabled a few modules, which I don't use, via a command line.

I've made it before already and had no problems with it.
But now I can't upgrade or deploy.

I get this error:

Invalid argument supplied for foreach() in /vendor/magento/module-store/Model/Config/Processor/Fallback.php on line 125

I've enabled the modules again, but the error stays.

What could I do?
Appreciate any help.

Solved
etc/env.php had only two lines. After reconstructing it from the backup everything is fine - except images in backend. Don't see product images and can't upload new.


texts:
We have developed custom admin module and i listed the grid view. But not able view the information of particular record.

We have tried , get the blank page

How to do this?


texts: Magento admin panel shows as html links with executable functions

texts:
I ran into problems while testing Amazon Payments button on my site and got into rewrite error. I restored my site from a backup database, but the admin panel is missing; only html links are showing up but the links are not executable. My config_data_file are ok where urls are concern and js and css files are not merged.

How do I restore the admin panel for use? Appreciate all advice. Thank you.


texts: Bundle product having a uneditable items or a different approach

texts:
What I need:

I have a product which could be said like a 3 month subscription of craft pack. There are 12 craft packs totally. Each month a craft pack should be shipped. The payment should not be recurring. The user has to pay for three packs in advance. A craft pack cannot be sold individually. Each pack should be shipped individually  each month. To manage inventory, each 3-subscription should translate to 3 orders. Eg: if user buys a subscription in september, then it should translate as september pack order, october pack order and november pack order. and shipped in respective months.

How I have organised and tried:

Subscriptions as bundled product

Each craft pack as a simple product bundled inside subscription

I have given the option to ship individually.

Problems I face:

Bundle Items give ability to edit through drop down/ multi select box. The packs are already bundled, so the user should not edit it.
The each items bundled should have quantity as 1. The user should not change it.

HOW TO SOLVE THIS PROBLEM. I am new to magento.
Am I in the right direction. Or is there an alternative to this.


texts: translation of Mr. and Mrs. prefix options

texts:
So I have to set a translation for the Mr. and Mrs. prefix options in the one-page checkout form, where a customer fills his name, address, etc.

All the translations so far I have done through the .csv files or in the template files, but this one I cannot find. Even by turning on the Translation inline for frontend - I cannot see which scope is for these 2 elements. I guess it's the Mage_Customer.csv but it doesn't work from there. Neither from the translate.csv file in the design/frontend directory.

Are these optional elements' translations somewhat different? I would appreciate some hints on how to achieve translating this.


texts: Why can 'edition' be passed as option to Mage::run

texts:
In Mage::run magento checks if an edition variable has been passed in its option array.

Why is this?

if (isset($options['edition'])) {
    self::$_currentEdition = $options['edition'];
}

I cant see anywhere in the codebase this is used.  Where is this used and why?


texts: setMassactionIdField keep selecting entity_id instead of custom id field

texts:
I'm having this weird problem and I can't find the solution for this anywhere from google. I want to add Massaction column for my custom module grid. I think my code is correct.

protected function _prepareMassaction()
    {
        $this->setMassactionIdField('paperprice_id');
        $this->getMassactionBlock()->setFormFieldName('paperprice');
        $this->getMassactionBlock()->addItem('delete', array(
            'label' => $this->_getHelper()->__('Delete'),
            'url' => $this->getUrl('*/*/massDelete'),
            'confirm' => $this->_getHelper()->__('Are you sure?')
        ));

        return $this;
    }

Unfortunately, it thrown error saying that 'entity_id not found'. Whereby im getting the collection from custom table that not have any 'entity_id' column.

a:5:{i:0;s:178:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.entity_id' in 'field list', query was: SELECT `main_table`.`entity_id` FROM `pb_componentprice` AS `main_table`";i:1;s:5320:"#0 /var/www/magento/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)

What is the reason? I believe it suppose to select 'paperprice_id' instead if 'entity_id'.


texts: Fedex/UPS Published vs Negotiated Rates huge discrepancy?

texts:
How are these rates calculated at all and is there any control over what gets published on our site in terms of shipping rates? Or rather, where is that controlled to begin with?

I've got the APIs and all that plugged into the Magento backend, and this is what I get for shipping estimates, for example:

http://prntscr.com/6x7qyt

But then when I check the same address in UPS/Fedex, I get a shipping cost that's quite higher (so we're losing money on shipping, pretty much):

http://prntscr.com/6x7qys

What's going on?

Shouldn't these two be the same, at the very least?

If there was a discrepancy of a few cents, I'd understand, but almost double the amount?

Isn't there more to this in terms of control, what gets pulled, which rates, or is it something to do with the Fedex/UPS API and settings?

I'm on v1.8.0.0

Thanks.


texts: Change order of store-views in multistore setup in ADMIN?

texts:
I have 3 store views ie ENGLISH, GERMAN and FRENCH language.

When I edit a setting or product details page, store views comes in orders/positions  as displayed in below image:

I want to change their  order/position like below ie ENGLISH on top

I have already tried setting order of store views in Store View Information


texts: Installed SUPEE 8788 patch not recognizing Magereport

texts:
I have installed the SUPEE 8788 patch without using SSH. I am using following link

How to install SUPEE-8788 without SSH

But magereport not recognized this patch.

My magento version is 1.9.2.4


texts: Magento group upsell products by category

texts:
i'm a newbie to magento, default using $this->getItemCollection()->getItems() (upsell.phtml) displaying all up selling products.

I'm wondering how to group these results by its category.

Example, i have 4 up sell products,

3 Products from category A,

1 Product from category B

On view i need to display like this,

Category A,

Product 1 | product 2 | Product 3

Category B,

Product 4

So far created a module, it's structure below,

local
   Fugen
     Accessories
        etc
          config.php
        Model
          Observer.php

My module's config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Fugen_Accessories>
            <version>1.0</version>
        </Fugen_Accessories>
    </modules>
    <frontend>
        <events>
            <catalog_product_upsell>
                <observers>
                    <Fugen_Accessories>
                        <class>Fugen_Accessories/observer</class>
                        <method>updateUpsells</method>
                    </Fugen_Accessories>
                </observers>
            </catalog_product_upsell>
        </events>
    </frontend>
</config>

My Observer.php

class Fugen_Accessories
{
    public function __construct()
    {
      // leave empty
    }

    public function updateUpsells(Varien_Event_Observer $oObserver)
    {
        $iCurrentCategory = Mage::registry('current_category')->getId();
        $oUpsellCollection = $oObserver->getCollection();
        foreach ($oUpsellCollection->getItems() as $key => $oUpsellProduct) {
            $aCategoriesIds = $oUpsellProduct->getCategoryIds();
            if (!in_array($iCurrentCategory, $aCategoriesIds)) {
                $oUpsellCollection->removeItemByKey($key);
            }
        }
    }
}


texts: Fatal error: Call to a member function initCache() while moving site

texts:
Moving Magento Website  from Localhost to Production Server
I have tried deleted the cache,session & updated my config core table with the right values

Fatal error:

  Call to a member function initCache() on a non-object in /home/domain/public_html/sitename/app/code/core/Mage/Core/Model/App.php on line 609

Thanks in advance.


texts: Filtered response does not show total records in response of REST APIs in Magento 2

texts:
I am using GET V1/products endpoint to fetch product list. I want to fetch sku and name only.

http://localhost/magento/rest/default/V1/products?searchCriteria[sortOrders][0][direction]=ASC&currencyCode=USD&searchCriteria[currentPage]=1&searchCriteria[pageSize]=10&fields=items[name,sku]

response

{
"items": [
    {
        "sku": "5245",
        "name": "Test Product"
    },
    {
        "sku": "product 1",
        "name": "product 1"
    },
    {
        "sku": "product 2",
        "name": "product 2"
    },
  ]
}

I am not getting total number of records in this response. I checked it on devdocs as well. It also has same type of response, please find link below.

Magento filtered response

Please help if anyone already faced this and solved it.


texts: How to rewrite Mage_Adminhtml_Sales_Order_CreateController correct?

texts:
I need to override Mage_Adminhtml_Sales_Order_CreateController which placed in app/code/core. Its saveAction() method, actually.

My config.xml looks like this:

And app/code/local/Magestore/Onestepcheckout/controllers/Adminhtml/Sales/Order/CreateController.php like this:

Magestore/Onestepcheckout module is active now.

There is another class which overrides Mage_Adminhtml_Sales_Order_CreateController in local pool, but placing method saveAction in there do nothing.

Does Anybody know what's wrong?


texts: How do I find out what user used what coupon code?

texts: I have a few coupon codes in my store, and I’d like to be able to track what code a user may have utilised. Inversely, is there a way to see how many times a particular code was used?


texts:
I'm looking to remove old quotes from the database via a Magento shell script, and I see enterprise_customer_sales_flat_quote and enterprise_customer_sales_flat_quote_address whose purpose is unclear to me. These are don't have any key constraint on them to the native Mage tables.

In the Enterprise_Customer module, under which the models for these tables are, there is not much responsible code. What are these for, and are they safe to remove along with the "associated" sales_flat_quote/_address records? ("associated" because there is no formal constraint but they seem to have the same entity_ids.


texts: Magento multi site - How does cache management work and have to clear cache?

texts:
I am having problems with the cache on 1 domain. I have a multi domain magento v. 1.6.

I have made some changes to a CSS file and cleared cache, but it have only updated on 1 domain. I have 3. I have seen in var folder that there are 3 folders, cache, cache1 and cache2. Can I just delete the contents of them without it have any negative effect on may site?

I have flushed the cache and storage in cachemanagement. But does it effect all 3 sites?


texts:
var dataForm = jQuery('#form');
dataForm.mage('validation');
function submitForm(){
    if (dataForm.valid()){
        dataForm.submit();
    }
}

Everything is working well what i want some kind of callback function when valid() returns false.

I tried and found that there is some option for adding custom error messages like

dataForm.mage('validation',{
    errorPlacement:function(error,element){
        var errorPlacement = element;
        errorPlacement.after(error);
        /* we can do custom stuff here */
    }
});

But this doesn't works well it only create element for first time when validation called.

I need callback function that call everytime whenever validation failed.


texts:
I installed free extension Magento 2 SMTP from Mageplaza

php composer.phar require mageplaza/module-smtp
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

The entire installation went successful.

The panel "Mageplaza" appeared in the administration panel but can not see the SMTP Extension here. Does anyone know how to solve this?

Here is our back-end:

here is a demo version of how it should be:


texts: How to show currency flag and code on top header in magento

texts:
My code is

<?php if($this->getCurrencyCount()>1): ?>

 <?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?> - <?php echo $this->getCurrentCurrencyCode()?>

        <?php foreach ($this->getCurrencies() as $_code => $_name): ?>
        <a title="<?php echo $_name ?>" class="currency_icon  <?php if($_code==$this->getCurrentCurrencyCode()): ?> selected<?php endif; ?>" href="<?php echo $this->getSwitchCurrencyUrl($_code) ?> " onclick="setLocation(this.value);"> <img src="<?php echo Mage::getBaseUrl('media').'flag/'.$_code.'.jpg'; ?>" title="<?php echo $_name ?> - <?php echo $_code ?>" alt="<?php echo $_name ?> - <?php echo $_code ?>" width="20" height="17" /> <?php echo Mage::app()->getLocale()->currency($_code)->getSymbol()?> - <?php echo $_name ?>
        <?php endforeach; ?>

I want to change flag in header too.

some thing like :


texts: Display custom attributes, but not in default tab

texts:
Magento shows custom attributes in the first tab after product main information.

Inside this tab I have some custom attributes that I would like to show in other place of the page (under sku for example).

How can I do this?


texts: setting all active quotes to inactive , for the logged user

texts:
This is the code I use, which is not working, in order to make all of active quotes for the logged user to inactive, but it keeps taking only one quote.

$quote = Mage::getSingleton('sales/quote');
$quoteID = $quote->getId();

while ($quoteID)
{

    // Set inactive
    $quote->setIsActive(0);
    $quote->save();

    // find next inactive quote <- NOT WORKING! $quoteID STAYS THE SAME!
    $quote = Mage::getSingleton('sales/quote');
    $quoteID = $quote->getId();

}


texts: Magento2: How to check if request is from Web Service?

texts:
In Magento 1, We used to check as:

if (Mage::getSingleton('api/server')->getAdapter() != null) {
    // request from Web-Service
}

How to check the same in Magento2?

I didn't find any proper adapter which fits for both REST & SOAP.


texts: Moving from Hostgator Magento 1.9.3.3 to Digital Ocean Magento 1.9.4.4

texts:
I am trying to move away from a HostGator VPS to a Digital Ocean VPS and also upgrade my Magento version in the meantime. I have a very basic knowledge of VPS and the LAMP stack.

So on Hostgator, I am actually using a WHM + CPanel setup and I would like to just manage it myself without the CPanel in DigitalOcean.

This is my current stack:

Magento Version: 1.9.3.3
Linux: CentOS release 6.10 (Final)
Apache: Apache/2.4.43 (cPanel)
MySQL: mysql  Ver 14.14 Distrib 5.6.43, for Linux (x86_64) using  EditLine wrapper
PHP: PHP 5.6.40 (cli) (built: Apr  7 2020 18:17:28)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies

From my understanding, since 2019, Magento 1.9.x.x started supporting PHP 7.2. Which is great news. I want to see if it is possible to set up a LAMP server on Digital Ocean with the lastest CentOS, Apache, MariaDB, and PHP. I would also like to start using the latest version of Magento 1: 1.9.4.4

This is my thought process for doing so.

Create a new droplet (Is this enough?)

1 GB Memory
1 vCPU
1 TB Transfer
25 GB SSD Disk

Install the latest version of LAMP on the newest version of CentOS.
Install the latest version of Magento on top of the LAMP stack.
Install the required PHP modules and Apache Modules
Backup the database on the old server and restore it on the new server.
Backup the files on the old server and add it to the new server. (I actually do not know which folders/files need to be migrated over if you can kindly help me list them out, that would be super).

Would these steps work out? I really do appreciate your help on this matter.


texts: How to set website id as 1 for all products in Magento

texts: We have 200 products in our existing Magento website and there more are made in them. Can anyone please let me how can we set website id as 1 for all existing and as well as new products in Magento.


texts:
The website was working fine without any issue, but now i am getting the following error "Fatal error: Class 'Magento\Framework\App\Bootstrap' not found in /public_html/app/autoload.php on line 40".

Please suggest what to do.
Thanks


texts: Technical review: Unable to apply patch InitializeWebsiteDefaultSock

texts:
I have written a simple extension for Magento 2 which I want to publish at the Marketplace.
But I am stuck for months to get it through the technical review process. While the CodeSniffer passes, the 2 other tests fail. This is my error message:

Unable to apply patch Magento\InventorySales\Setup\Patch\Schema\InitializeWebsiteDefaultSock for module Magento_InventorySales.
Original exception message: The default website isn't defined. Set the website and try again.

I tested various PHP-Versions in the composer-file, various patches I found on the Internet, and various dependencies. Everything failed. Since this is a black-box I really have no idea.
If somebody has a hint or an idea, please let me know! BTW the source code is free and can be found here: https://gitlab.bounce-experts.com/bounce-experts-plugins/magento-2-bounce-experts-and-recombee-power-pack
I have some newer versions which should work with Magento 2.3. and 2.4 together, but since the error message in the review has never changed, I have not committed it yet.
The changes are related to the BounceExperts\BMRecombeePowerPack\Block\Widget\RecommendedProducts
now it's extending Magento\CatalogWidget\Block\Product\ProductsList class but this class has changes in the __construct method for 2.3 and 2.4 and the order of dependencies is different which is causing compilation issues on 2.4 so this class is no longer extending ProductsList class.
Thank you in advance!


texts: How to not show GA on "Do Not Track" header

texts:
I would like to receive instructions on how to not echo Google Analytics JS when user browser send header "DNT".

I would like to know if:

Would i have to make an extension on the GA block class to get the $_SERVER to check whether it should return null or the JS code
Would there be any way to do that on XML
Should i do it on the "display" (i mean the design/template)


texts: How to use Postman with Magento 1.9 SOAP API

texts:
I can't find a good example anywhere of how to use postman application for testing the Magento 1.9 SOAP Api. The REST Api is not enough for my needs.

I have tried a POST request using https://example.com/api/v2_soap?wsdl=1 as the URL, and in the body : raw , XML ( text/xml ) .

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <MAGE:login xmlns:MAGE="http://example.com/api/v2_soap/?wsdl=1">
            <MAGE:username>username</MAGE:username>
            <MAGE:apiKey>password</MAGE:apiKey>
        </MAGE:login>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And the response is just the WDSL page. I'm a bit baffled by that and have tried various combinations of removing the ?wsdl=1 parameter .


texts: Trying to get data in Frontend based on fields from custom table on DB

texts:
I'm trying to get the value based on the field input like email, contactno on the input field in frontend, my getagentdata.php is below,

<?php
namespace Webkul\Pos\Controller\Index;

class GetAgentData extends AbstractPos
{

public function execute()
{
    $returnArray             = [];
    $returnArray["success"]  = 1;
    $returnArray["message"]  = "";
    $returnArray["agent"] = [];
    try  {
        if ($this->_coreSession->getIsLoggedin()) {
            $wholeData   = $this->getRequest()->getParams();
            $agentId  = $wholeData["agentId"]  ?? 0;
            $searchQuery = $wholeData["searchQuery"] ?? "";
            $searchQuery = trim($searchQuery);
            $agentCollection = $this->_agents->create()->addNameToSelect();

            if ($agentId > 0) {
                $agentCollection->addFieldToFilter("id", $agentId);
            } else {
                $agentCollection->addFieldToSelect("email")
                    ->addFieldToFilter(
                        [
                            ["field"=>"email", "like"=>"%".$searchQuery."%"],
                            ["field"=>"contactno", "like"=>"%".$searchQuery."%"]
                        ]
                    );
            }
            $agentCollection->setOrder("id", "DESC");
            $agentData = [];
            foreach ($agentCollection as $agent) {
                $eachAgentData = [];
                $eachAgentData = $agent->getData();
                $eachAgentData["id"] = (int)$eachAgentData["id"];
                $eachAgentData["firstname"] = $eachAgentData["firstname"];
                $eachAgentData["lastname"] = $eachAgentData["lastname"];
                $eachAgentData["contactno"] = $eachAgentData["contactno"];
                unset($eachAgentData["is_active"]);
                unset($eachAgentData["created_at"]);
                unset($eachAgentData["updated_at"]);
                unset($eachAgentData["password"]);

                $returnArray["agent"][] = $eachAgentData;
                //$eachAgentData->debug();
            }
            $returnArray["success"] = 1;
        } else {
            $returnArray["message"] = __("Session Expired.");
        }
        return $this->getJsonResponse($returnArray);
    } catch(\Exception $e) {
        $returnArray["message"] = $e->getMessage();
        return $this->getJsonResponse($returnArray);
    }
}
}

But magento2 returns this error.

  {"success":1,"message":"Warning: Illegal offset type in isset or empty in /var/www/sqdelivery/vendor/magento/framework/Data/Collection/AbstractDb.php on line 423","agent":[]}

if i comment the below else part, Error is not coming

else {
            $agentCollection->addFieldToSelect("email")
                ->addFieldToFilter(
                    [
                        ["field"=>"email", "like"=>"%".$searchQuery."%"],
                        ["field"=>"contactno", "like"=>"%".$searchQuery."%"]
                    ]
                );
        }

I think problem is on the addFieldToFilter & addFieldToSelect.

Please help me to solve this error. Thanks in advance.


texts: Right side Related Products bar Loaded Twice

texts:
I am running a magento product with own theme. Enabled related products on catalog/layouts/catalog.xml. But in my product view page it is showing twice.

I found few more posts with duplicating content twice (description, etc..) I followed all steps. But still I cant guess how does the related product tab showing twice.

I have below lines in my theme /app/design/frontend/default/MYTHEME/catalog.xml

<reference name="right">
            <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
        </reference>

there is no locale.xml as well.. But magically even when i removed above two lines related products are being loaded.


texts: Client side mobile validation in magento2

texts:
I added one field of mobile number in customer/account/create form. I want to put validation in mobile field which allow 10 digit mobile number format . If mobile number format is not valid then display error message as per email id validation.

As per mention in image i want to display error message for mobile number validation.

How to apply client side validation for mobile number?

Please help me...

Thanks in advance :)


texts:
I'm running CE 1.9.0 & I've created a sub theme of the rwd template.

So I have folders like so:
app/design/frontend/rwd/mytheme/layout/local.xml
app/design/frontend/rwd/mytheme/templates/ - currently empty

skin/frontend/rwd/mytheme/css/custom.css

In local.xml I have the following directive:

 <default>

    <reference name="head">

         <action method="addItem">
              <type>skin_css</type>
              <name>css/custom.css</name>
          </action>

      </reference>
    </default>

However, the custom.css is being output at the top - even before the various js files, so that the rwd theme css is overriding my changes.

Within the Admin UI I have the following Design settings

Anyone know why my custom.css is being output first, rather than last as I'd expect?

Thanks,
Eddie


texts: How to get pop up on button click popup with ajax call

texts: On Shipping method section after  select shipping option i want to open pop Up with 2 button submit & cancel on click on submit button i want to check my logic via ajax call


texts: How can I fix this error I received after migrating my Magento site to new server?

texts:
SQLSTATE[42000] [1044] Access denied for user 'db_user'@'localhost' to database 'database_db'

Trace:
#0 /home/account/sitename/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/account/sitename/lib/Varien/Db/Adapter/Pdo/Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/account/sitename/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/account/sitename/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/account/sitename/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/account/sitename/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/account/sitename/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /home/account/sitename/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /home/account/sitename/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /home/account/sitename/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /home/account/sitename/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /home/account/sitename/app/code/core/Mage/Core/Model/Cache.php(478): Mage_Core_Model_Resource_Cache->getAllOptions()
#12 /home/account/sitename/app/code/core/Mage/Core/Model/Cache.php(520): Mage_Core_Model_Cache->_initOptions()
#13 /home/account/sitename/app/code/core/Mage/Core/Model/App.php(1202): Mage_Core_Model_Cache->canUse('config')
#14 /home/account/sitename/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#15 /home/account/sitename/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#16 /home/account/sitename/app/code/core/Mage/Core/Model/App.php(424): Mage_Core_Model_Config->loadModulesCache()
#17 /home/account/sitename/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#18 /home/account/sitename/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#19 /home/account/sitename/index.php(83): Mage::run('', 'store')
#20 {main}


texts:
With new requirements in Colorado taking effect soon, it will be required for online retailers to now collect based on delivery address.

This means that for every order an API request needs to be made with the address as the request data and a breakdown of tax jurisdictions with rates as the JSON response.

{"totalRate":0.049850,"rates":[{"rate":0.029000,"name":"CO STATE TAX","type":"State"},{"rate":0.009850,"name":"CO COUNTY TAX","type":"County"},{"rate":0.010000,"name":"CO SPECIAL TAX","type":"Special"},{"rate":0.001000,"name":"CO SPECIAL TAX","type":"Special"}]}

When I have looked at working on this previously a number of years ago, I ended up creating Magento Tax Zone/Rates on-the-fly with the ID of each mapped to the Zip5+4 of the customer's address as provided by a separate call to the USPS address validation API. This was a terrible solution in practice and wasn't fit for production use.

Have any changes been made to Magento's Core which allow a simpler way of completely ignoring the built-in Tax models and simply applying a sales tax rate dynamically with a single API call during checkout?

I know there are various paid solutions and varying qualities of third-party extensions/integrations. These often do not meet the requirements of Colorado and/or are paid monthly subscriptions which is not what I am interested in.


texts: One VirtualHost, multiple aliases and store access issues

texts:
I'm getting 404 / apache error issues while trying to configure multiple stores having the same domain name and specific URI "directory"

What I have done

vhost config

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "/var/www/html/dev-site/code"
    ServerName my.domain.local

    Alias /alias1 /var/www/html/dev-site/code
    Alias /alias2 /var/www/html/dev-site/code
    Alias /alias3 /var/www/html/dev-site/code

   <Directory /var/www/html/dev-site/code>
            Order allow,deny
            Allow from all
            AllowOverride All
            RewriteEngine On
            Options +FollowSymlinks
    </Directory>

    SetEnvIf Request_URI ^/alias1(.*) MAGE_RUN_CODE=pf_view
    SetEnvIf Request_URI ^/alias1(.*) MAGE_RUN_TYPE=store

    SetEnvIf Request_URI ^/alias2(.*) MAGE_RUN_CODE=es_view
    SetEnvIf Request_URI ^/alias2(.*) MAGE_RUN_TYPE=store

    SetEnvIf Request_URI ^/alias3(.*) MAGE_RUN_CODE=ta_view
    SetEnvIf Request_URI ^/alias3(.*) MAGE_RUN_TYPE=store
</VirtualHost>

Magento config

In core_config_data, default base_url is set to "http://domain.local/" (so we can access admin at http://domain.local/admin)
Each store base_url is set as "http://my.domain.local/aliasX/" (replace X by 1, 2 or 3)
Every single js/media/skin base url is explicitely specified and common for all aliases (e.g. http://my.domain.local/js/)
index.php is tweaked so it can handle "REDIRECT_" server vars :

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
if ('' == $mageRunCode) {
    $mageRunCode = isset($_SERVER['REDIRECT_MAGE_RUN_CODE']) ? $_SERVER['REDIRECT_MAGE_RUN_CODE'] : $mageRunCode;
}

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
if ('store' == $mageRunType) {
    $mageRunType = isset($_SERVER['REDIRECT_MAGE_RUN_TYPE']) ? $_SERVER['REDIRECT_MAGE_RUN_TYPE'] : $mageRunType;
}

What I get

This config is not enough (or is wrong) to make it work :

In index.php, when I dump $mageRunCode just before the Mage::run() line, I get the correct value
All homepages work (http://my.domain.local/aliasX/)
When I set RewriteBase to /alias1/, all /alias1 based urls are working but not the others
All other aliases' urls are redirected to alias1 homepage (and the dump shows the alias1 run code). This is normal, as I set RewriteBase to /alias1/

What I already tried and isn't described above

I tried tu use <Location> in my vhost config to set conditional RewriteBase. But with Locations set, my urls are not correctly redirected to index.php and I get the good ol' white apache 404 page (with apache error logs like this one : File does not exist: /var/www/html/dev-site/code/catalog, referer: http://my.domain.local/alias1/)

What I dont want

vhost aliases pointing to subdirectories + duplicated .htaccess and index.php in these subdirectories

Any help, clue, link - you name it - will be highly appreciated (I'm not a sysadmin and currently wasting my client's money not being able to solve this issue)


texts: Display Reward Points on Product Page in Magento 2 EE

texts:
I have setup a custom module to display some information underneath the 'Add to Cart' button on product pages. The information that I would like to display is the amount of reward points that a customer can obtain by purchasing the product.
The reward points are taken care of by the default Magento 2 EE rewards module (magento/module-reward).
Is there a way to programmatically get the reward points for each product?
Cheers,
Max


texts: I want to translate api error messages in arabic. please let me know how I can do it. I have tried using csv but not working.


texts: One URL which will direct to the correct store (based on location and language)

texts:
I know this isn't a very Magento question, but I'm hoping someone in the community has dealt with this.

We have a multi-store setup with more than 10 stores (different languages and domains), which share many products between them.

The problem:

If we want to do a product promotion on say - Instagram, and include a product URL in the description, it would only be one store (obviously, its dumb to direct a Spanish customer to a Danish site), so:

How to create a "universal" URL which will automatically redirect the customer to the correct store (based on location and language).

Note: Our sites do have hreflang with alternate hrefs set up.


texts: Magento 2 : Flush static files cache delete my files in pub folder

texts:
Whenever I click the additional cache management buttons in admin panel , it deletes the files in pub folder.

I don't know what is the reason for this.

Anyone know about this?

please help me.


texts: logging into magento 2 customers area using 3rd party API

texts:
I have a remote API that will validate existing customers' credentials and log them into Magento 2 customers' area.

The target flow is the following:

Customer visits Magento site
Fills in username and password
Submit the form
Magento will call the API that looks something like this:

  http://api/login?username=$customer_username&password=$customer_password

If the credentials are correct, the API will return a json object with user details. Like email, first name, last name...etc
The customer is logged into Magento.

I figured I need a custom module for this, my confusing is:

Can I leverage existing Magento login form, or do I need to create my own form + URL + blocks/templates.
The custom form will have it's Controller that will do all this logic, or is there a way to hook into existing login controller.
I have to create a user in Magento DB as well.

Thanks in advance.


texts: Detect if customer already exists when placing an order from admin

texts:
Can I implement an ajaxcheck that will fire as soon as the email address is entered when an order is placed for a new customer from the admin in Magento 2? This is meant as a safeguard for placing an order for a customer that already exists.

Currently, the check will happen after the 'Submit Order' button is pressed and if the customer exists all the order information needs to be input again after selecting that customer from the customer grid.


texts: magento 1.9.0.1 customer cannot login and redirect back to login

texts:
already checked the 1.8 bug with the formkey.

All files have the appropriate addition

<?php echo $this->getBlockHtml('formkey'); ?>

caches, sessions and cookies cleared.
But still not working.

Any idea how to get that to work?

Cookies seem to work (orders can be placed).


texts: Magento override getProductUrl to check if product is assigned to specific Root Category/child

texts:
I am overriding Mage_Catalog_Model_Product method getProductUrl($useSid = null).
how to check whether the product is assigned to specific "Root Category A" or its sub categories or not?


texts: Modman - dealing with template files spread across multiple modules

texts:
I use modman for development and will typically have a core module in the client namespace for the heavy lifting of the customisations such as the theme, locale base install/upgrade scripts etc.

Additionally, for any specific customisations to core code i will create a custom local module in the client namespace and then extend the relevant Magento module.

My modman directory may look similar to this:

ClientName_Core
ClientName_Catalog
ClientName_Newsletter
ClientName_Cms

The core module will hold the theme and skin to keep all of that contained in 1 place.  However, this causes a problem for me.

If one of the specific extended modules needs to create custom template files then they would be symlinked into the already symlinked design directory from the Core module.  It then gets a bit messy.

How do other developers out there deal with this situation and organise their modman directory?


texts: How to add custom attribute [ shop_by_brand ] filter in layered navigation without using admin in Magento 2.1 ?

texts:
I want to add shop_by_brand attribute in layered navigation without using backend admin.I have created this attribute using schema:-

 $eavSetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY,
        'shop_by_brand',
        [
            'type' => 'varchar',
            'backend' => '',
            'frontend' => '',
            'label' => 'Shop by Brand',
            'input' => 'multiselect',
            'class' => '',
            'source' => '',
            'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
            'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => 0,
            'searchable' => false,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => true,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]
    );


texts:
Im trying to create a custom module that handles values by store view level.

Anyway if the user does not select anything i want to get the default scope value at website level, im doing this in a multistore setup.

This is what i have already:

$data = $this->scopeConfig->getValue("payment/get_section/$section/$field");

Im getting the field with this set up at store view level because i think this is the default scope.

I have already tried by adding:  ScopeInterface::SCOPE_WEBSITE but im still getting the same value as before, the store view value, any ideas?


texts: How can I hide a shipping option if that option is available as flat-rate or free?

texts: My store has UPS Ground available at a Flat-Rate for most orders, but customers are selecting the normal UPS Ground service.  I'm not sure how to make it so that the normal ground option is not available if the order is eligible for Flat-Rate or Free shipping.


texts: How do you get values from Quote_address table Magento 2

texts:
I have added new column in Quote_address table but I am not able to get the value when i do the following steps;

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
 $billingAddress = $order->getBillingAddress();
 $shippingAddress = $order->getShippingAddress();

Is there anything wrong in this code ?

Thank you in advance.


texts: Shopping Cart Rules Page Not Loading Correctly in Admin Area

texts:
I have recently inherited a Magento 1.9.2.4 site from a previous developer. When we try to add new Shopping cart price rules, we get a blank screen on the add new rule page. The page looks like it is getting a Prototype error, but cant seem to find how to fix this. Any help would be much appreciated.

Please see screenshots attached for the issue and the console log error.


texts:
Trying to disable all cache types in Magento 2 from System > Tools > Cache Management.

But all I get is the following error:

  Deployment config file env.php is not writable.

I tried making app/etc/env.php writable (777) but still no luck.


texts: How do I get connection to database by entering Database details in Magento 2?

texts:
I want to get custom database connection by adding database details in my custom script without using ResourceConnection.

In Magento 1 we can do like this

$conn = new \mysqli($servername, $username, $password, $database);

How can we do like this in Magento 2?


texts: Problem with Magento 2 and CloudFront AWS

texts:
I have a Cloud Front distribution that servers files from '/pub/static' folder of Magento.

This distribution has that configurations above:

But some files are broken because it's not on cloud front.

What I'm doing wrong?


texts: Magento 2.3.2. Multistore robots.txt wrong sitemap URL

texts:
A client has a Magento 2.3.2 multistore with 5 stores. For convenience I name them store 1/5. The store has created 5 sitemaps in magentoroot/sitemap/{storename}/sitemap.xml.

The robots.txt I assume are configured under content/design/ -> edit / Search Engine Robots.

The problem: Google is not indexing store 2/5 because the sitemap refers to the sitemap of store 1.

I assume Magento needs to inject the correct sitemap into the robots.txt for each domain. However here it gets curious.

I added a "Disallow: /test/" to the Global SEO settings. This results in store 2/5 also getting this /test/ marker in robots.txt, but not store 1 (which is the main store). It is not taking the settings from the Global/Website 2/5 SEO settings.

My questions.

How can I make sure the right sitemap gets injected in robots.txt
How can I make sure each of these 5 domains gets their own robots.txt

I really appreciate the feedback.


texts:
Its possible to apply a coupon, in to the first purchase for new customers?

i don't know where is the option to apply coupon the first purchase.

Its possible? or i need some extension?


texts: How to judge if given number is order Id or increment Id

texts: I am having form with input box, we have to check if entered number is order Id or increment Id.


texts: Set tax, multiple shipping address when creating order programmatically

texts:
While creating order programmatically, I just want to set tax and discount which was applied for the order.

And If the order was used multiple shipping address feature, then how can I set multiple shipping address while creating it. However billing address can be set as follows:

$orderData = [
                        'currency_id'  => 'USD',
                        'email'        => $ordValue[0],
                        'billing_address' =>[
                            'firstname'    => $ordValue[15], //address Details
                            'lastname'     => $ordValue[16],
                            'street' => $ordValue[17],
                            'city' => $ordValue[18],
                            'country_id' => $ordValue[19],
                            'region_id' => $ordValue[20],
                            'region' => $ordValue[20],
                            'postcode' => $ordValue[21],
                            'telephone' => $ordValue[22],
                            'fax' => $ordValue[23],
                            'save_in_address_book' => 1
                        ]
                    ];

And it can be added into the quote as

$quote->getBillingAddress()->addData($orderData['billing_address']);

If anybody knows, please post our solution which would be really helpful to me.

-Thanks


texts: Magento2 compliling specific theme deploy error --area does not exist

texts: I wanted to deply chosen theme by using the guide from here when I run magento setup:static-content:deploy --area frontend --no-fonts --theme Magento/luma the error is --area does not exist and I'm on Magento 2.1.0.


texts: I need to show all associated products of config if all of them are out of stock

texts:
For e.g. If i have a config product with 1 associated product & that associated product is out of stock, then by default magento2 will display out of stock message & this associated option will not be shown. I wasnt to show this associated option even when that single product is out of stock.

How can I achieve this?


texts: What mean of "product online" or offline in magento 2.0?

texts:
What mean of "product online" or offline in magento 2.0 ?
Please explain this mean of words "product online", if you know.


texts: Magento 2, How to add a control in custom option in configuration product

texts:
Using Magento 2, Configuration Product, Custom Option. I need to add check-box for hide custom option item price in front page.

Backend

  Catalog -> Configuration Product

Front

  Product option in will show like this if check hide price from back-end


texts: Magento 2 order email into spam because of use system account

texts:
New order emails in my Magento 2.2.1 are going to spam, and i know why because tested it in mail-tester.com. Magento 2 uses the system account to send emails and thats not a good idea, because i am using a cloudserver.

The sender is in that case cloud.tricotstoffen.nl

I want to send from an adress i made in my email server. Can i use an other account than the system account?


texts: Magento 2: How to add fontawesome icons for each category top-menu item?

texts:
I'm using Magento v2 and want to have icons added to the left side of each category menu item.
How can I accomplish this? I'm using a custom premium theme. When I try to see the template path by enabling template path hint, the category top-menu disappears! So I can not figure out the right template file to edit.
Is there anyone to tell me what's the right way to customize category template?
Thanks


texts: Can I add a special price on my standard tier pricing?

texts:
I have set a promotional action in the magento admin by adding a special price on product level.
The products have also a tierpricing system.
I would like to also add a special price on the tierprice values as part of the promotional action.
I am eagered to hear advice on how to handle this issue.


texts: Render fields base on attributes to system.xml

texts:
Is there way to list all of catalog attributes in my custom catalog tab?

each attribute as field label and a text input field, basically mapping a text to an attribute name  / key

or if there is a way to better accomplish this

my current way is having a select field with source model pulling all the existing attributes, but this approach limits number of fields I add, and is not user friendly having them to select from list of attributes every time

            Custom
            <tab>attribute</tab>
            <resource>custom::custom_attribute</resource>
            <field id="import_att1" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                Module Mode
                <source_model>Custom\Custom\Model\Config\Source\Attribute</source_model>
            </field>
...


texts: All address field validation in customer account page

texts:
I need to do validation on server side on customer account page.That is, edit address  I can validate id=street1(inspect address field1),working fine.How to validate for other address fields - street2 and steet3.
I do address validation by extend edit template file from customer.


texts: Tips to speed up the handling of large product collections in backend

texts:
I'm dealing with a large database (roughly 70k products) to help me manage my products more efficiently it was necessary to modify the admin panel to allow larger collection of products. In my case 5000 products and 10,000 products for the View drop down under Manage Products.

The problem is that "Please wait" appears for a period ranging between 5 to 15 minutes before the products load and sometimes they don't load at all.

My store is running on a dedicated server [dual quad core Xeons, 12GB memory] so there is no reason why it cannot handle this, so I'm trying to track down where I can tweak some settings to make it more responsive.

The front end is lightning fast, the back end is fast with the exception of the large collection of products.

Mysql has been tuned, using Redis Cache and APC as a backend, not sure what else to do to speed this specific issue up. I'm sure those with large databases can benefit from this.

What settings can be tweaked in order to make handling of large collections of products more efficient in the Magento back end?


texts: How to properly edit Magento 2 stylesheets? And what to do next to see it in the frontend?

texts:
I'm new to Magento 2.0. I purchased a theme and I want to edit some styles. I checked in the firebug it's showing

url/pub/static/frontend/vendor_name/theme_name/en_US/css/styles-l.css

I made some research but I can't get clear instructions if it's ok to edit the file inside the static folder. I've read some that if I will edit it, it will be remove if I will do some static-content:deploy, is this true? If yes then what will I do to edit it?

I tried going to app/design/frontend/vendor_name/theme_name/web/css/source but I didn't find any LESS for the styles-l.css. Please can someone give me a guide on where will I edit or copy and move it from and to?

Btw, the theme inherits the Magento_Blank.

Looking forward to anyones expertise.


texts:
What is the safest way to remove the entire Yotpo module in a Magento 2.3 store?

This module is installed and enabled by default.


texts: 404 Server response on admin connect and reindex pages

texts: Any idea why my reindex page and magento connect page in admin is displaying a 404 message? I have changed permissions on both downloader and shell folders and all files to 755. Changed ownership back to server. Does not recognize command when reindexing via ssh.


texts: How to add footer Miscellaneous HTML in Magento 2.1?

texts:
Trying to add Miscellaneous HTML in the footer section of Magento 2.1 but I cannot locate this field anymore in our Magento 2.1.0 store, see screenshot below:

In Magento 2.0 the same page had many more sections: Design Theme, HTML Head, Header, Footer, Product Image Watermarks, Pagination & Emails, see screenshot below:

Does anyone know if these sections have moved elsewhere in Magento 2.1? Can't seem to find these anywhere in my backend...

Any chance this could be because of the Porto theme used?


texts: Get page title and link of parent CMS page in CMS Hierarchy

texts:
Is there a good method for retrieving the page title and url of the parent CMS page when using Magento's CMS Hierarchy?

Example Structure:

About Us

Culture
Contact

I need to be able to get the About Us page title on Culture and Contact pages.

The only method I've come up with is this terrible code which grabs the parent page's title:

<?php echo ($_tree[0][3]->getData("page_title")); ?>

Right now it's showing the current page title instead of the parent page title: http://grab.by/Drl4 as I'm using the code:

<?php echo str_replace(Mage::getStoreConfig('design/head/title_prefix'), '', $this->getLayout()->getBlock('head')->getTitle()); ?>

Any ideas of a reusable and clean method to grab the parent CMS page's title and url?

side note : I have magento-enterprice editition with me.


texts: How to get products from wishlist using customer id

texts:
Magento 2.3 PHP 7.1

I trying to get products from customer wishlist in Model but $products array is empty.

        $products = [];
        $items = $this->wishlist->loadByCustomerId(1, true)->getItemCollection();
        foreach ($items as $item) {
            $product['name'] = $item->getProduct()->getName();
            $product['sku'] = $item->getProduct()->getSku();
            array_push($products, $product);
        }
        var_dump($products);

How to get products from wishlist in Model using customer id?


texts: Two admin modules design showing same page?

texts:
I have created two different modules (app->code->local->1) Mca, 2) Mba & design-> adminhtml->default->Course->layout-> 1) mca.xml 2) mba.xml) and its working fine to accessing front end modules. When I go to back end modules they are showing different menus but In Mca module displaying both modules (mca & mba) design, but to accessing Mba module displaying empty page. I don’t’ know why displaying both modules in same page, but I give separate actions for both.

Can anyone tell me where I went wrong?

Thanks in advance.


texts:
An old webshop of ours has a _MACOSX folder in its directory. When I backup the webshop it takes a very long time to backup _MACOSX folder. Probally because it is a whole copy of the files in the directory.

Is this folder usefull? Or has this folder been created by someone who uploaded the site from a Apple computer?

If not usefull can it just be deleted?


texts: How can i insert custom tracking url in Order confirmation Email Template?

texts:
I want to insert my custom tracking url in Order Confirmation email and url is
https://vitalticks.shiprocket.co
i put code like this
Track you Order here:Vitalticks Order Tracking Page
But it is not redirecting to the custom url.
Please help me to solve this issue.


texts: Magento 2: Meta-keywords and meta-description doesn't appear

texts:
I am using a payment template that unfortunately the support has already expired.

Meta-keywords and meta-description do not appear in the source code. I've assigned to the different websites and products, but nothing, its doesn't appear in the code absolutely anything.

I've been looking for information and I have not found anything.

How can I check if the keywords and description are missing in the template?

How can I add them?


texts:
I updated my store from 1.9.0.1 to 1.9.2.4 and the order confirmation mail isn't working. I tried it manually by sending invoice through admin and it did work but it's not working on automatically. I even setup the cron but however, I think the cron is not working properly because the URL www.mysite.com/cron.php redirects me to 404 page not found.

And yes, I am testing all this on my test domain, my production website does send all the emails which is currently on 1.9.0.1
Any solutions?


texts: I have a code that is being passed in via the URL (akin to the Google source codes) that I want to add to the quote and order. I already have a function that triggers on the event controller_front_init_routers that adds the data to the session to pull out later, and I've added the field to both the quote and order tables. However, I'm not able to add the data to the quote at that point since the quote doesn't exist in the event. Which event would be the best time to add my code to the quote?


texts: How to get current custom transactional email template ID

texts:
I'm making some changes on the following file:
app/design/frontend/base/default/template/email/order/items/order/default.phtml

and what I need is to check if there's a custom trasactional email template used, and if it is, I'd like to get it's ID.
(System > Transactional Emails)

I have no idea how to do this! Could you please help me?

EDIT : SOLUTION
(based on Marius suggestions)

In file addp/design/frontend/base/default/layout/sales.xml, after <sales_email_order_items>...</sales_email_order_items>
 I added the following code

<sales_email_order_items_dupl>
    <block type="sales/order_email_items" name="items" template="email/order/items.phtml">
        <action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default_duplicate.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default_duplicate.phtml</template></action>
        <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
            <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
            <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
            <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
                <action method="setIsPlaneMode"><value>1</value></action>
            </block>
        </block>
    </block>
    <block type="core/text_list" name="additional.product.info" />
</sales_email_order_items_dupl>


texts:
I have done below code in my event observer to add custom column to my sales order grid and still do not display the column to my website's admin panel?

Here is my code:

app/code/community/Mjsi/Orderprint/etc/config.xml

<adminhtml>
 ---
  <events>
        <core_layout_block_create_after>
            <observers>
                <mjsi_orderprint_add_columns>
                    <class>Mjsi_Orderprint_Model_Observer</class>
                    <method>addColumnsToGrid</method>
                </mjsi_orderprint_add_columns>
            </observers>
        </core_layout_block_create_after>
        <core_block_abstract_prepare_layout_before>
            <observers>
                <orderprint_core_block_abstract_prepare_layout_before>
                    <class>Mjsi_Orderprint_Model_Observer</class>
                    <method>addMassAction</method>
                </orderprint_core_block_abstract_prepare_layout_before>
            </observers>
        </core_block_abstract_prepare_layout_before>
        <adminhtml_widget_container_html_before>
            <observers>
                <mjsi_orderprint>
                     <class>Mjsi_Orderprint_Model_Observer</class>
                     <method>adminhtmlWidgetContainerHtmlBefore</method>
                </mjsi_orderprint>
            </observers>
        </adminhtml_widget_container_html_before>
  <events>
 ---
</adminhtml>

app/code/community/Mjsi/Orderprint/Model/Observer.php

<?php

class Mjsi_Orderprint_Model_Observer
{
/**
 * Add new column to orders grid
 *
 * @param Varien_Event_Observer $observer
 * @return $this
 */
public function addColumnsToGrid(Varien_Event_Observer $observer)
{
    $block = $observer->getEvent()->getBlock();

    // Check whether the loaded block is the orders grid block
    if (!($block instanceof Mage_Adminhtml_Block_Sales_Order_Grid)
        || $block->getNameInLayout() != 'sales_order.grid'
    ) {
        return $this;
    }

    // Add a new column rigth after the "Status" column
    $block->addColumnAfter('mjsi_orderprint', [
        'header' => $block->__('Printed'),
        'width' => '80px',
        'filter' => false,
        'renderer' =>'Mjsi_Orderprint_Block_Adminhtml_Sales_Order_Renderer_Printed',
        //'index' => 'coupon_rule_name',
    ], 'status');

    return $this;
}

public function addMassAction(Varien_Event_Observer $observer)
{
    $block = $observer->getEvent()->getBlock();

    if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
        && $block->getRequest()->getControllerName() == 'sales_order')
    {
        $block->addItem('massPrintSalesOrders_order', array(
            'label' => 'Print Sales Orders',
       'url' => Mage::app()->getStore()->getUrl('*/*/massPrintSalesOrders'),
        ));
    }
}

public function adminhtmlWidgetContainerHtmlBefore($event) {

    $block = $event->getBlock();
    if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
        $block->addButton('order_print', array(
            'label'     => Mage::helper('sales')->__('Print Orders'),
            'onclick'   => 'setLocation(\'' . $block->getUrl('*/*/print') . '\')',
        ));
    }
}
}