texts: How to execute a block function in home page?

texts:
This is My Layout file.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Vendor\Namespace\Block\Index\Custom" template="Vendor_Namespace::cms.phtml"/>
        </referenceContainer>
    </body>
</page>

This is My block file:

 <?php
    namespace Vendor\Module\Block\Index;

    class Custom extends \Magento\Framework\View\Element\Template
    {
        public function Newly(){
       return "hello";
    }
    }

Phtml File

<?php echo Newly();
?>

But no changes in home page


texts: Magento Generates System.log as Only variables should be passed by reference

texts:
System.log generates following Error

2014-06-28T12:34:58+00:00 ERR (3): Strict Notice: Only variables should be passed by reference  in
 D:\INETPUB\VHOSTS\DOMAINNAME\app\design\frontend\THEME\default\template\directory\currency-top.phtml on line 9

The Code at Line 9 is as follows :

$last_item = end(($this->getCurrencies()));

I referred this URL & this, But No Success


texts: Why does Magento (v1.9) uses styles.css from base/default instead of my own theme (Porto)

texts:
I installed Porto theme in Magento, and I can see that the images and overall layout is from this theme. But, it is still taking the styles.css form base/default and displays firebug error, because it doesn't even exist. Also, the design looks distorted and I can clearly see that CSS is missing. These are some of the settings and directory structure:

Path to my porto theme in app is: app/design/frontend/smartwave/porto
Path to my porto theme in skin is: skin/frontend/smartwave/porto

Things I did and things I tried:

In General -> Design I set the package to smartwave,
In General -> Design I set theme section fields (skin, layout, default) to porto.
I cleared the cache as well.


texts: How to stop customer registration if the validation fails?

texts:
I am creating a module to validate club card number. There is one additional field added in the customer registration form which validates the number entered by user.

I have called the observer on controller_action_predispatch_customer_account_createpost event.

My XML code is a below:

<events>
    <controller_action_predispatch_customer_account_createpost>
        <observers>
            <tescoclubcard_validate>
                <type>singleton</type>
                     <class>tescoclubcard/observer</class>
                     <method>validateTescoCardNumber</method>
            </tescoclubcard_validate>
        </observers>
    </controller_action_predispatch_customer_account_createpost>
</events>

In Observer.php file I have performed all validation. I am throwing the exception when the card number is not valid. The function code is as below:

public function validateTescoCardNumber($observer = null, $number = null){
        $event = $observer->getEvent();
        $controllerAction = $event->getControllerAction();
        $params = $controllerAction->getRequest()->getParams();

        // Retrives card number from the controller action.
        $tescoClubCardNumber = $params['tescoclubcard_number'];
        if($tescoClubCardNumber != NULL){
            $tescoClubCardStatus = $this->checkCard($tescoClubCardNumber);
        }
        try{
            if($tescoClubCardStatus == "N"){
                Mage::throwException('Invalid Tesco Club Card Number');
            }
        }catch(Mage_Core_Exception $e){
            $session = Mage::getSingleton('customer/session');
            $session->addError($e->getMessage());

        }
    }

Here, the exception is thrown successfully and the error message is printed out properly but still the account is created which ideally shouldn't have been done.

I want to stop the customer registration and redirect customer back to create account page with the error message displayed as it happens for normal customer registration invalid fields.

Can anyone please provide an insight on how can I work this out.


texts:
We are migrating from shopify to magento. What is the best way to move the customer database into magento so they have the same login details? Or if that's not possible, what would be "best practices" in this kind of scenario?

Thanks


texts: Observer for mass product attribute queues

texts:
I would like to do some extra custom actions after a product price is changed.
I was thinking to use the catalog_product_save_after event when a mass price update is done from the Product Grid -> Actions -> Update Attributes (via the bin/magento queue:consumers:start product_action_attribute.update).
I've created the events.xml file in the etc folder with this content:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_product_save_after">
        <observer name="catalog_product_save_after_queue"
                  instance="Vendor\Module\Observer\ProductSaveAfterQueue"/>
    </event>
</config>

This is my ProductSaveAfterQueue content:
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class ProductSaveAfterQueue implements ObserverInterface
{
    public function execute(Observer $observer)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/custom.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('Here');
    }
}

Unfortunately, my log file is not created :(  Do you know why and what kind of event or approach should I use instead ?
Thanks


texts: How to turn off browser auto-fill Magento2

texts:
I'm looking to turn off browser autofill feature on checkout, the solution is added autocomplete="false" in the form tag.

  e.g) <form autocomplete="false">

In Magento 2 using UI components, I don't see any form tag on view page source.

any idea how to turn off browser autofill?


texts: Magento 2 How to override adminhtml Js components

texts:
Basically I want to override grid.js component file in Magento 2
Require config

  view/adminhtml/require-config.js

Require config code.

var config = {
    map: {
        '*': {
            customScript:'Acx_Grid/js/custom'
        }
    }
};

I want to know process how to override J's component in backend.


texts: Magento 2 - Where are data-bind attributes defined?

texts:
In the file vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html there is this code:

Where is product_url and product_name defined?
How does it know where to get the data from?


texts: magento2 : so many jquery & require.js error when activating ssl

texts:
Magento2: so many jquery & require.js error when activating SSL. On Backend & Frontend Both.

Is there any common problem?

Error screenshot: Front End

Error screenshot: BackEnd


texts: Getting error after adding arguments in constructor

texts:
I have added model in my constructor

public function __construct(
    Context $context,
    PageFactory $resultPageFactory,
    \Vendor\Module\Model\Productsgrid $model
)
{
    $this->model = $model;
    $this->resultPageFactory = $resultPageFactory;
    return parent::__construct($context);
}

After adding model I am getting this error:

  Fatal error: Uncaught ArgumentCountError: Too few arguments to
  function...

When I am removing Productsgrid model it's working fine, am I doing something wrong?


texts: Assign a separate theme to product pages and categories

texts:
I have magento 2 and a requirement to show a certain category, subcategories and product pages in those categories using a different layout then other product pages on my store.

So just to be clear:

I have a category page which shows a list of subcategories
I have a sub category page which shows a list of products
and a product page

each one of the above has a different functionality then other categories/products of my site.

So, I have a theme that I created that I assigned to the category and the subcategories that I need. It works great. But, I did not find a way to assign a theme to a product page. I had to assign the theme to the entire site for the theme to be applied to product pages. This defeats what I need to do

Am I missing something? What is the right approach?


texts: creating invoices by admin for pay on delivery

texts:
I was wondering if there was any way to create an order and send the invoice to the customer for a pay on delivery. We created a new site, but in the past customers ordered by sending their order directly to me and then I enter the order and create an invoice and wait for them to send a check. I would like to be able to continue to do this for the select customers.
I know there is a way to have pay on delivery for a payment option but when I select it, it becomes visible for the customer to view which we do not want.
Thanks


texts: $product->addImageToMediaGallery() ignoring mediaAttribute parameter

texts:
I'm adding images to products using the addImageToMediaGallery() function like so:

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$product = Mage::getModel('catalog/product')->load(1234);

try {
    $product->addImageToMediaGallery($filePath, ['small_image', 'thumbnail', 'image'], false, false);
    $product->save();
} catch(Exception $e) {
    echo $e->getMessage();
}

The images are uploaded to the gallery as intended but the media attributes (small_image, thumbnail, image) seem to be ignored and are not selected on the newly uploaded image.

I'm running Magento CE 1.9.2.2


texts: The value specified in the URL Key field would generate a URL that already exists after migration from M1

texts:
I have migrated the project from Magento 1 to Magento 2.3.4 everything is working fine.
But In admin when I try to change the category name it shows me error
The value specified in the URL Key field would generate a URL that already exists.
Why I am getting this error even if I am changing the category url key
Search Engine Optimization  >> URL KEY


texts:
I am getting the following error message a few times a day, and my knowledge of the inner workings of Magento CE 1.9.0.1 is thin enough that I don't know if this is normal, advisory behavior from Magento, or if it is telling me I have a bad problem.

Here is the message:

  One or more of the Cache Types are invalidated: Blocks HTML output. Click here to go to Cache Management and refresh cache types.

Refreshing that particular cache makes the problem go away for a couple hours or so.

I am not currently editing layouts, products, etc., nothing at all.

What is wrong and how can I correct it?


texts:
Hi i just created custom module in magento and its frontend doesn't work.

The config file :

<?xml version="1.0"?>
<config>
<modules>
    <Shareino_Sync>
        <version>0.1.0</version>
    </Shareino_Sync>
</modules>

<global>
     <helpers>
        <sync>
            <class>Shareino_Sync_Helper</class>
        </sync>
    </helpers>
    <blocks>
        <sync>
            <class>Shareino_Sync_Block</class>
        </sync>
    </blocks>
</global>
<frontend>
    <routers>
        <sync>
            <use>standard</use>
            <args>
                <module>Shareino_Sync</module>
                <frontName>sync</frontName>
            </args>
        </sync>
    </routers>
    <layout>
        <updates>
            <sync>
                <file>shareino_front.xml</file>
            </sync>
        </updates>
    </layout>
</frontend>

</config>

The layout file  :

# File in : app/design/frontend/default/default/layout/shareino_front.xml
<layout version="0.1.0">
    <sync_index_index>
        <reference name="content">
            <block type="sync/sync" name="sync" template="sync_index.phtml" />
        </reference>
    </sync_index_index>
</layout>

And sync_index.phtml :

# file in app/design/frontend/default/default/template/sync_index.phtml
<h1>
    Test Text
</h1>

I created a block that named Sync.php

class Shareino_Sync_Block_Sync extends Mage_Core_Block_Template
{
    public function myfunction()
    {
        return "Hello tuts+ world";
    }
}

At the end my controller  :

class Shareino_Sync_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction(){

            $this->loadLayout();

            $this->renderLayout();

    }
    public function testAction(){
        echo "index Action";
    }
}

I think i done every think well , but when i load the action url in browser it doesn't my layout. please help me to know my wrong.


texts: Can't change my docroot back without breaking my site

texts:
I changed my docroot to /pub. It's now a few weeks later, and I realize that quite a few of my changes on the backend aren't showing up on the frontend.
When I now try to change my docroot back to /public_html, the static content won't deploy, no matter how many times I kick the app into production/developer mode, or use static-content:deploy, or clear the caches.
Any reason I wouldn't be able to change my docroot back?
Thanks


texts: Is there any possible way to make one spread sheet that generates configurable products as well as all the simple products, link them and also contain image data? I have found "MAGMI" but it says I should do them in pieces of simple products then configurable products. I am trying to import a configurable tshirt product with simple sizes and colors.


texts: Magento2: How I can display country and region drop down fields to admin form in Magento2

texts:
I am developing a custom admin module. I have displayed country and region in admin custom module. It is working when I add country and region. But it is not working with edit action.

How I can show country and region which already saved in edit action?

I have Used below code for that in form _prepareForm()

$country = $fieldset->addField(
$field['fields'],
'select',
[
    'name' => $field['fields'],
    'label' => __('Country'),
    'title' => __('Country'),
    'values' => $optionsc,
    'required' => $require
]
);*/

$fieldset->addField(
'region_id',
'select',
[
    'name' => 'region_id',
    'label' => __('State'),
    'title' => __('State'),
    'values' => ['Please select a region, state or province'],
    'required' => $require
]
);

$fieldset->addField(
'region',
'text', ['name' => 'region', 'label' => __('State'), 'title' => __('State'), 'display' => 'none']
);

/*
* Add Ajax to the Country select box html output
*/
$country->setAfterElementHtml("
<script type=\"text/javascript\">
        require([
        'jquery',
        'mage/template',
        'jquery/ui',
        'mage/translate'
    ],
    function($, mageTemplate) {
       $('.field-region').hide();
        $(document).ready(function(){

            $('#item_country').bind('change', function () {
                $.ajax({
                   url : '" . $this->getUrl('b2b_company/lists/regionlist') . "country/' +  $('#item_country').val(),
                   type: 'get',
                   showLoader:true,
                   dataType: 'json',
                   success: function(data){
                        if(data.htmlconent == false){
                            console.log('two');
                            $('.field-region_id').css('display', 'none');
                            $('.field-region').css('display', 'block');
                        } else {
                            $('.field-region').css('display', 'none');
                            $('.field-region_id').css('display', 'block');
                            $('#item_region_id').empty();
                            $('#item_region_id').append(data.htmlconent);
                        }
                   }
                });
            });
            $('#item_country').trigger('change');
        });
    }

);
</script>"

Also I am trying it with : Another Solution but it has used $formData array but not define any where.

Thanks You.


texts: Show Delivery Time over or under Availability on Products Page

texts:
I am completely new to magento.
I use Magento 2.3 and I created an attribute Lieferzeit under Stores->Attributes->Product and set visibility to yes.

Further, I set the Attribute to a group in Stores-Attributes-> Attribute Set.

What is the next step here?
I am confused.


texts: Magento 2.2.6 CMS homepage content goes here

texts:
I am getting CMS homepage content goes here. content on the front page as well as on the admin panel with no images and any other content,
how to resolve this issue.
Run below commands also
sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
sudo chown -R nginx:nginx .
sudo chmod u+x bin/magento
rm -rf var/cache/* var/page_cache/* pub/static/* generated/*
mage setup:upgrade
mage s:d:c
mage s:s:d
mage c:f

I am using
Magento 2.2.6
centos 7
PHP 7.0 with FPM
NGINX
SSL on


texts: Magento 2 How load product by sku and boot the system minimally?

texts:
Me need minimal load system that get ONLY: Product Name, Product Type, Product Url, Thumbnail Url, Price, Sub products for Configurable.

Preferably use catalog_product_flat_ table (i think it's good idea for optimization)

How can I do it?

Help me,

Thanks!


texts: Magento 2: - Set WYSIWYG editor near to custom option in admin side

texts:
We created text box near to custom option can it be possible to put wysiwyg?

Code we use for that

StackExchange\Affordablemantel\Plugin\Catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions\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">
    <type name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions">
        <plugin name="stackexchange_affordablemantel_custom_option" type="StackExchange\Affordablemantel\Plugin\Catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions" sortOrder="1"/>
    </type>
</config>

StackExchange\Affordablemantel\Plugin\Catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions.php

<?php
namespace StackExchange\Affordablemantel\Plugin\Catalog\Ui\DataProvider\Product\Form\Modifier;

class CustomOptions
{

    public function afterModifyMeta(
        \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions $subject,
        $meta
    ) {
        $meta['custom_options']['children']['options']['children']['record']['children']['container_option']['children']['container_common']['children']['custom_text'] =
        $this->getTitleFieldConfig(
            200,
            [
                'arguments' => [
                    'data' => [
                        'config' => [
                            'label' => __('Custom Text'),
                            'component' => 'Magento_Catalog/component/static-type-input',
                            'valueUpdate' => 'input',
                            'imports' => [
                                'optionId' => '${ $.provider }:${ $.parentScope }.option_id'
                            ]
                        ],
                    ],
                ],
            ]
        );
        return $meta;
    }

    /**
     * Get config for "Title" fields
     *
     * @param int $sortOrder
     * @param array $options
     * @return array
     */
    protected function getTitleFieldConfig($sortOrder, array $options = [])
    {
        return array_replace_recursive(
            [
                'arguments' => [
                    'data' => [
                        'config' => [
                            'label' => __('Custom Text'),
                            'componentType' => \Magento\Ui\Component\Form\Field::NAME,
                            'formElement' => \Magento\Ui\Component\Form\Element\Input::NAME,
                            'dataScope' => 'custom_text',
                            'dataType' => \Magento\Ui\Component\Form\Element\DataType\Text::NAME,
                            'sortOrder' => $sortOrder,
                            'validation' => [
                                'required-entry' => false
                            ],
                        ],
                    ],
                ],
            ],
            $options
        );
    }
}

create a column 'catalog_product_option' table same as field name. e.g: custom_text


texts:
I was checking for H1 tags on my home page and found that i have 3.
1 is from the logo which i believe is acceptable for Seo.
There are two others, one is the category-title and i dont know where the 3rd comes from.
Firstly how can i change the homepage category title Tag H1 to something else, or better still what should it be. (without changing other page category titles)
Seconedly where does the other H1 tag come from? and how can i remove it or change it.
Hope somebody can advise.


texts: Magento configurable products: when customer selects a size "SAVE" it for next product view

texts:
We have a website for fashion. If/when a customer buys shoes or clothing they generally shop ALL products in the same size. And this got me thinking.

When a customer selects size 42 when buying a shirt: Is it possible to "save" this value and when the customer opens the next product the size dropdown is already pre-selected to size 42?

Maybe we should call it a "sticky" attribute


texts: Sort by price is not working as expected in magento 2.2.7 product listing page

texts:
when I sort by price product order in Asc or dec. In product listing shows like, First product price is 40, second product price is 50 and the third product price is 40.

If I opened and save those 50 price product in admin backend that product, it's working fine.

All product have customizable options. When I run the following script it's working fine. But this script will delete those customizable options.

<?php

use Magento\Framework\App\Bootstrap;

include 'app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');

$productCollection->load();

foreach($productCollection  as $product)
{
 $product->save();

}

echo "saved";

Find any possible way to fix this issue.
advance thanks


texts: How to create oauth_signature for OAuth-based authentication using Magento 2.0 REST API

texts:
How to understand how to create an oauth_signature for OAuth-based authentication in Magento 2.0 REST API requests?

Assuming I use PHP's hash_hmac:

hash_hmac ( 'sha1' , $string , 'Integrations-Consumer-Secret' );

I'm not sure what $string should contain


texts: Magento 2 products are not being added to cart

texts: Does anyone know why this would be happening. My SSL cert is not installed correctly, can this be an issue? If not what can it be? I am taken to the cart page but it's empty.


texts: Trigger a cron job on custom form submit in magento 2?

texts:
Can I trigger a cron job at the time of form submission?

Actually, I need to download a product pdf when the form gets submitted.

But my pdf file has a large amount of data. So the site gets slow down.

So that I have moved on to cron.

I've successfully set a cron by referring this link.

Here is my code,

/etc/crontab.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">

<group id="default">
    <job name="test_cronjob" instance="Test\CatalogPrint\Cron\Pdfdownload" method="execute">
        <schedule>*/1 * * * *</schedule>
    </job>
</group>
</config>

Cron/Pdfdownload.php

<?php

namespace Test\CatalogPrint\Cron;
class Pdfdownload extends \Magento\Framework\App\Action\Action
{
    // doing my stuff on here
}
?>

And my form in the template file,

form.phtml

<form action="<?php echo $block->getFormAction() ?>" method="post" class="downloadPDF-account">
    <label>Brochure Name: <input name="pdfname" type="text" /></label>
    <input type="submit" value="Download" />
</form>

Actually now in this form action <?php echo $block->getFormAction() ?>'  , I given my controller path.

But I need to run my cron file (Test\CatalogPrint\Cron\Pdfdownload) on here.

If I'm doing the same stuff on my controller, means it takes too much time and slow down my site.

Please help me. I am a novice in magento and I am stuck at this point. Thank you in advance!!


texts: Where magento 2 send mail, when create customer from admin

texts: Anybody know where magento 2 in adminhtml customer creation, get email template, put it in transport builder, and send mail to customer with cunfirmation link.


texts: Deny layered navigation to search engines

texts:
A common issue: enabling layered navigation on a shop with many products, will produce an exponential amount of unique URLs. Besides the issue with possible SEO penalties for duplicate content, this might invoke a DDoS attack on your server.

Example: my current client has only 10K SKU's, but over a 100K daily requests from Google and Bing.

So, how to deny layered navigation for crawlers and save precious recources for real visitors?

There seems to be multiple strategies:

Add filters to robots.txt, as described here and here
The same, but configured in the webserver
Add nofollow and noindex in the template files as described in this Byte blogpost

Are there more? Which is the best?


texts: Multidimensional Arrays in Magento WSDL file (WSI compliant)

texts:
Have been working to get an API call working to edit an order via API, and remove items or quantity from a current order and save as a new order.

My issue is with passed an array of items & qty's to my api method "amend"

$result = $proxy->salesOrderAmend(
    array(
        "sessionId" => $sessionId,
        "orderId" => $id,
        "amendData" => array(
            array(
                'order_item_id' => 46,
                'qty'   => 1
            )
        ),
        "comment" => 'comment here',
        "notifyCustomer" => 1,
        "includeComment" => 1
        )
    );

The amendData uses the existing wsdl complexType orderItemIdQtyArray. Everytime i try to access this array of data in my method I get a blank stdClass returned.

Here is my WSI.xml file

<wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
    <xsd:complexType name="salesOrderAmendData">
            <xsd:sequence>
                <xsd:element name="qtys" type="typens:orderItemIdQtyArray" minOccurs="0" maxOccurs="unbounded"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:element name="salesOrderAmendRequestParam">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string"></xsd:element>
                    <xsd:element minOccurs="1" maxOccurs="1" name="orderId" type="xsd:string"></xsd:element>
                    <xsd:element minOccurs="0" maxOccurs="1" name="amendData" type="typens:salesOrderAmendData"></xsd:element>
                    <xsd:element minOccurs="0" maxOccurs="1" name="comment" type="xsd:string"></xsd:element>
                    <xsd:element minOccurs="0" maxOccurs="1" name="notifyCustomer" type="xsd:int"></xsd:element>
                    <xsd:element minOccurs="0" maxOccurs="1" name="includeComment" type="xsd:int"></xsd:element>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="salesOrderAmendResponseParam">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element minOccurs="1" maxOccurs="1" name="result" type="xsd:string"></xsd:element>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
</wsdl:types>

And here is the existing elements I am using:

    <xsd:complexType name="orderItemIdQty">
        <xsd:sequence>
<xsd:element name="order_item_id" type="xsd:int"></xsd:element>
<xsd:element name="qty" type="xsd:double"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="orderItemIdQtyArray">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="complexObjectArray" type="typens:orderItemIdQty"></xsd:element>
</xsd:sequence>
</xsd:complexType>

Can anyone see what I am doing wrong? I am literally Mage::log the $amendData param in my method: -

public function amend($orderId, $amendData, $comment = '', $notifyCustomer = 0, $includeComment = 0)

But getting no data.


texts:
I create custom page layout. In admin area select this layout:

  Amin -> Products -> Categories -> MyCategory -> Design -> Layout

Q: How add css class to body tag?

My file:

  app/design/frontend/{Vendor}/{theme}/Magento_Theme/page_layout/custom.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="1column"/>
    <!-- my references -->
</layout>

Tried, but not work:

<body>
    <attribute name="class" value="my-class" />
</body>
----------------------
<referenceContainer name="root" htmlClass="my-class" />
----------------------
<referenceContainer name="root">
    <argument name="css_class" xsi:type="string">my-class</argument>
</referenceContainer>

Update. PY Yick answer not work too (for me):

<referenceContainer name="root">
    <arguments>
        <argument name="css_class" xsi:type="string">my-class</argument>
    </arguments>
</referenceContainer>


texts: Fatal error: Class Helper_Data' not found in app\Mage.php

texts:
Please help me guys to fix it :

  Fatal error: Class 'Mage_Parcelamento_Helper_Data' not found in
  C:\wamp64\www\magento\app\Mage.php on line 547

Error log

  Warning: include(Mage\Parcelamento\Helper\Data.php): failed to open
  stream: No such file or directory in lib\Varien\Autoload.php on line
  94


texts: Get customer details by using Authentication Token

texts:
I use this Magento 2 rest api to get customer token:

curl -X POST "https://my.project/rest/V1/integration/customer/token" \
     -H "Content-Type:application/json" \
     -d "{"username":"me@awesome.com", "password":"d00l1tle"}"

i successfully got the token, and i pass the token in header when i access my custom magento 2 webapi

Authorization: Bearer <authentication token>

webapi.xml

<route url="/V1/test/most/" method="GET">
      <service class="Vendor\Module\Api\TestRepositoryInterface" method="getTest"/>
      <resources>
          <resource ref="self"/>
      </resources>
  </route>

i want to retrieve the customer information in my getTest() function base on customer token which is use as Authorization header


texts:
When minimum order amount is set to 50 within admin the below errors are shown on frontend.
Frontend errors:

Only one product can be added to cart, can't add second product to cart

Products cannot be removed from cart on cart page

When clicking checkout button below error shown


texts: Maximum Qty Discount is Applied To: only applying once regardless of how many times are set

texts:
OK so I'm using C4B Freeproduct extension for this. This basically adds in functionality for you to choose a product as a free gift if certain criteria are met. This adds the functionality directly to the shopping cart price rules promo section.

So I don't know why it won't apply a rule more then once, but it only applies it once. The modules observer.php contains this:

 /**
 * Make sure that a gift is only added once, create a free item and add it to the cart.
 *
 * @param Mage_Sales_Model_Quote $quote
 * @param Mage_Sales_Model_Quote_Item $item
 * @param Mage_Sales_Model_Quote_Item $rule
 */
protected static function _handleGift(Mage_Sales_Model_Quote $quote,
                                      Mage_Sales_Model_Quote_Item $item,
                                      Mage_SalesRule_Model_Rule $rule) {
    if ($rule->getIsApplied()) {
        return;
    }

    $qty = (integer) $rule->getDiscountAmount();
    if ($qty) {
        $freeItem = self::_getFreeQuoteItem($quote, $rule->getGiftSku(), $item->getStoreId(), $qty);
        self::_addAndApply($quote, $freeItem, $rule);
    }
}

I cannot figure out for the life of me how to modify this at all to allow a rule follow the Maximimum Qty Discount Applied To Field: but If anyone can help in this it's most appreciated. I have tried for the past 4 days modifying code creating functions and I just keep running into a dead end. Can someone please help here.


texts:
I face one issue with createAttachment method. This method attached pdf but pdf not open and its size is zero kb.

     $html .= "
         <html>
         <head>
         </head>
         <body>
           Test pdf
         </body>
         </html>";

     $attachment = $emailTemp->getMail()->createAttachment($html);
     $attachment->type = 'application/pdf';
     $attachment->filename = 'test.pdf';
     $attachment->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
     $attachment->encoding = Zend_Mime::ENCODING_BASE64;

     $emailTemp->send($useremail,$Username,$emailTempVariables);

Please help me ASAP. what is wrong here?
I want to attached pdf with custom HTML in magento.


texts: How does '@method Address setCollectShippingRates(int $value)' work?

texts:
Magento 2.2, Clsss 'Magento\Quote\Model\Quote\Address'. I cannot find body of method 'setCollectShippingRates()'.

<?php

namespace Magento\Quote\Model\Quote;

/**
 * Sales Quote address model
 *
 * @api
 * ................
 * @method Address setCollectShippingRates(int $value)
 **/
 class Address extends \Magento\Customer\Model\Address\AbstractAddress   implements
\Magento\Quote\Api\Data\AddressInterface
{
  .............
}


texts: Magento process returns and change order (Magento CE 1.8.1)

texts:
we sometimes get returns (Yeah, only sometimes ;P)

and this is something I haven't been able to grasp: how do I process these returns and changes as simple as possible.

For instance:

Can I return the product for another size? [same config product, different simple product based on size]
Can I add a product?
Can I return the product for a different product?

What we do now is: credit note the order. Then create new order by clicking create new order, new customer, enter all the data

Is there a faster way to handle the above situations?


texts:
In my new Magento2 shop (I migrated the data from a Magento 1 instance), I have gross prices for all products in all StoreViews. The Magento1 instance had net prices. I changed all prices from net to gross values and the global tax settings/display after migrating.
The tax calculation and display settings are all based on the scope of the default config. So no special settings for other StoreViews or Websites. All display and calculation settings are set to "Including Tax".
Now comes the part which confuses me for a few days. When I open the shop of the main StoreView (which extends all it's setting from the default scope), I see the gross prices and everything is fine. But when I view the same product another StoreViews I get completely confusing prices. There are no advanced pricings active, no price rules, no other tax display setting for the Store Views. Maybe I am missing some settings, so I hope some experienced Magento people can give me some advice.
Here is a table of what I see in admin and inside the shops for one product. To have a better understanding, I switched the tax display to "including and excluding tax" for testing.
|         | Admin | Store frontend (gross) | Store frontend (net) | Store tax | Currency |
|---------|-------|------------------------|----------------------|-----------|----------|
| Store1* | 35.99 |                  35.99 |                31.03 |       16% |   € (DE) |
| Store2  | 32.99 |                  34.13 |                28.44 |       20% |   £ (GB) |
| Store3  | 32.95 |                  34.37 |                28.41 |       21% |   € (NL) |

* Store1 equals the "All Store Views" scope
I would expect to see the admin values in the Store frontend, but the shop is always showing me the price inside the "Store frontend (gross)" column.


texts:
I need count the orders of a given customer only if the order contains a specific category, how to modify this to get what I want ?

ex : if the order has a product from the category "watches", I want to count in the result the this query.

EDIT

Basically I need this :

    $nbOrders = 0;
        foreach($orders as $order){
         $items = $order->getAllItems();
         foreach($items as $item){
          $id = $item->getProductId();
          $categories = $item->getCategory();
          if(in_array("specific category", $categories)) $nbOrders++;
        }

}

But with factory it would be easier and cleaner

protected $_orderCollectionFactory;
protected $orders;
public function __construct(
    .....
    \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory,
    .......
) {
    ...
    $this->_orderCollectionFactory = $orderCollectionFactory;
    ........
    parent::__construct($context, $data);
}

public function getOrders()
{

    if (!$this->orders) {
        $this->orders = $this->_orderCollectionFactory->create()->addFieldToSelect('*')->addFieldToFilter('customer_id',$customerId)->setOrder('created_at','desc');
    }
    return $this->orders;
}


texts: Item level status in magento 2 via Netsuite

texts:
We have used Netsuite for items shipment tracking, now I don't know on which table of Magento 2, Netsuite updates item level status.

Like for an order, there can be multiple items, and I have to show the item level status(shipment status). But I don't know which table entry goes.

sales_orders has order level status.


texts: I want to change the looks of this cart page as well i want to add some other information. How can i achieve it?


texts:
I'm attempting to reindex my Category Products but i keep getting the following error. I'm can't make heads nor tails of it, any one have any ideas?

  Exception message: SQLSTATE[23000]: Integrity constraint violation:
  1452 Cannot add or update a child row: a foreign key constraint fails
  (magento.catalog_category_product_index, CONSTRAINT
  FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID FOREIGN KEY
  (category_id) REFERENCES catalog_category_entity (entity_id) ON
  DEL)


texts: How to call Adminhtml Controller on form action in magento 2?

texts:
I have created a custom module.
Which adds a custom tab on product_edit page.
Custom tab have multiple images and text boxes.
this all include in 1 custom form like this...

<form action="<?php echo $baseurl.'admin/AdminSample/sampleOne';?>" method="post" enctype="multipart/form-data">

and i want on Save button click the form should call controller in which i can handle all posted data.

I have tried call controller using basepath, but it always redirect me to admin dashboard.


texts:
My site was hacked having magento version 1.9.1.1, now I have upgraded it to 1.9.3.3 and scanned it with maldet.Removed all the infected files also.
Checked site with link, report saying

Security patch 5344 (Shoplift)is unknown
Security patch 8788 not patched
Brute force attacks? unprotected

Is there any way to check, remove and prevent malware completely.

Thanks in advance:)


texts: Products not updating with load product model by id in magento2

texts:
When I load product by below code then product name not updating. what  problem in my code?

foreach ($catval as $p) {
    $model = $p->MODEL;
    $NAME = $p->NAME;
    $product = $objectManager->create('\Magento\Catalog\Model\Product');
    $productId = $product->getIdBySku($model);
    if (false !== $productId) {
      $product = $objectManager->create('\Magento\Catalog\Model\Product')->load($productId);
      $product->setName($NAME);
      $product->save();
    }
}


texts:
I'm struggling to override or get in the middle of some checkout action scripts, for example the place-order method of app/code/Magento/Checkout/view/frontend/web/js/view/review.js

I can see there is a "beforePlaceOrder" variable in there but I'm unsure how to subscribe my own method there.


texts: How to restrict onepage checkout to not load address same as billing when select "Ship to different address" on frontend?

texts:
I am using Magento 1.9.1
and using IWD onepage checkout. On checkout page, when I fill in billing address information and then decide to ship on different address, by unchecking the "Ship to this address" checkbox, it displays Shipping address form and it's fields are filled with the information filled in the billing address form above. As you can see the examples below,

and when I uncheck the "Ship to this address", it display shipping address form filled with the same address as billing:

I don't want to load the same billing address information in the Shipping address when I uncheck the "Ship to this address".
How can I restrict to fill the fields automatically ? where to make changes ? whether to the controller or phtml to edit ?
Tried a lot but couldn't find where it is filling in the information into the Shipping address fields. I am a beginner at magento, any kind responses would be appreciated. Thanks.


texts: Custom Multiple columns filter in magento admin order grid

texts:
i am adding multiple columns in magento order grid they are working fine as separate filter but when choose multiple column nothing shown

if ($block->getId() == 'sales_order_grid') {
             $data=Mage::getModel('name/name')->getCollection()->setOrder('position','ASC');
            foreach($data as $dat)
            {
            $block->addColumnAfter(
                'some name',
                array(
                    'header'   => 'name',
                    'align'    => 'left',
                    'index'    =>  $dat->getId(),
                      'renderer'  => 'renderer class',

                    'sortable'  => false,

                    'type' => 'options',
                    'options' => $this->_getOptions($dat->getId()),

                    'filter_condition_callback' => array($this, '_filtercolumn'),

                ),
                'id_of_column_to_be_after'
            );
             $block->sortColumnsByOrder();
            }
        }

this is filter code

public function _filtercolumn($collection, $column)
    {
        if (!$value = trim($column->getFilter()->getValue())) {
        return;
    }
$collection->getSelect()->join('tablename')->where("`tablename`.order_id=`main_table`.entity_id AND `tablename`.column1='$value' AND  `tablename`.column2='$columnid'");

    $collection->printLogQuery(true);

    return $collection;
}


texts: Magento installation error from command line

texts:
I tried to install magento CE- v2.3.1, from the windows command line interface.
Instead of full command i used the short one, as
"magento setup:install "
I did not provide the full arguments because it was not taking the full command, gives the error every-time.
Next when i tried above command, Magento installed successfully.
But now i am not able to login into the Admin panel. as the message appears there is :
The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.
I want to know what will be the solution of this one as i am unable to log into the admin panel?
Can magento make admin username and password automatically, if not provided to?
how could i get rid from this issue or i will have to reinstall magento?
Note:
I made the database there in the DB through the phpmyadmin, but there wasn't any data stored about the admin. kindly help me.


texts: Magento 2 - Issue in Generate data which will use for performance testing

texts:
When I generate data to use for performance testing by running following command

php bin/magento setup:perf:generate-fixtures

It gives the following error in Tax rates step

Any help, experience and knowledge sharing would be appreciated.


texts: Magento 2 Categories and subcategories doesn't show up on sidebar

texts: I'm using Magento2 with Venustheme - Yume , and I created some product categories , with some subcategories , that also have other subcategories , But on the sidebar they doesn't show up, the strange thing is that they show up on another category that only has subcategories , without any eventually subcategories to the subcategories..


texts: Magento 2: Issue with PayPal Express checkout

texts:
I have integrated Paypal express checkout on my Magento 2 website. It's redirecting to PayPal after checkout. But when I'm login to the Paypal account I'm getting an error message.

We’re sorry. This seller doesn’t accept payments in your currency. Please return to the seller and choose another way to pay.

Although I have allowed all currency and primary currency is USD.


texts: product export duplicate row in Magento 2.1.2

texts:
I try to export products from admin as

Open admin panel
Edit any product
Add description that has quotes "
Save Product
Go to System - Export - Products
Export products

it should be single row for one record


texts: Magento 2 Catch customer creation event on both frontend and admin

texts:
I'm aware of the event emitted from CreatePost.php

$this->_eventManager->dispatch(
    'customer_register_success',
    ['account_controller' => $this, 'customer' => $customer]
);

but this is only for frontend new customer event, I have to find the best area to enter some code that runs only once when a new customer is created.

Edit: customer can be created thru frontend, API, admin page. And I need to catch all.

Edit 2: I'm trying to find the last event when a customer is created or edited, I have to run a reindex command after.

Thanks in advance.


texts: Magento 2 module creation - Enabling without command line

texts:
I have purchased a hosting which supports magento 2. I use cpanel to create DB and upload files and installed it successfully. Am trying to learn module creation by this tutorial...

http://inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2/

When i encounter the following line...

 php bin/magento setup:upgrade

which was supposed to be executed via commandline for the new module to get registered... i struckup.... from the very beginning i did not use commandline for anything here and am not comfortable with that too. Just wondering if there is a alternate way in magento to enable a custom module that i develop.

Note: the hosting i have doesnot offer ssh access so there is no way i can browse to that page and run that command.

Pls help me understand this... am new to magento development...


texts: How to used same code in helper data in magento 2?

texts:
Here is my object manager code can any one guide me how can i used same code in my helper data
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customOptions = $objectManager
                       ->get('Magento\Catalog\Model\Product\Option')
                       ->getProductOptionCollection($_product);
$custom_option_data = $customOptions->getData();

and call in phtml file


texts:
Magento 2.3.1
When I send a test mail, I get this error:

  An exception was raised while creating
  "Zend\Mail\Protocol\Smtp\Auth\Login"; no instance returned

Logs:

  main.CRITICAL: An exception was raised while creating
  "Zend\Mail\Protocol\Smtp\Auth\Login"; no instance returned
  {"exception":"[object] (Magento\Framework\Exception\MailException


texts: Way to keep track of credit card authorization expirations?

texts: Is there a a way to keep track of time left on authorizations with your credit card processor? Basically we authorize at the time of purchase and capture when the item ships. The issue is we have 10 days to authorize but because we do samples of our work and also often deal with weekends and holidays, we find those 10 days go by fast and we forget to do captures. I was wondering if anybody made a module which allows me to keep track of all open authorizations, when they will expire, how much time is left,etc. This would be vital to my business.


texts: Magento 2.3.X css updated after certain time in custom theme

texts:
I have used Porto theme and create a child theme with custom CSS file. Sometime css is not updated instantly and take certain time to update.

I have already contacted the server support and they told there is no issue of the server and must be an issue of my file.

I have already performed the following actions  :

  Remove pub/static, var/cache, var/page_cache
  Deploy theme
  Cache refresh

Anyone have an idea regarding this?


texts: Is Magento 2's cart price rule free shipping only applicable on table rate shipping method?

texts:
I have created a Custom Shipping method and I just noticed that the free shipping cart price rule is not applying.

While doing some trial and error, it turns out that the cart price rule will only be applied to the table rate shipping method and not on other shipping methods like flat rate.

This leads me to my question, is Magento 2's cart price rule free shipping is only applicable on table rate shipping method?

If so, how can I apply the cart price rule free shipping on my custom shipping method?


texts: Magento2- How to add a block after Cart Total on Cart and Payment

texts:
In Magento 2.3.5 How can I add a block of code/static content after Cart Total on checkout_cart_index.xml and checkout_index_index.xml?
I want this block should be observable so that if Cart Total changes it should also reload.
Want to add content below Order Total likewise on the payment review section also

Cart Total is changing according to product fees radio buttons (Mageworx Multi Fees extension)


texts: How to add phone mask to checkout page in magento2?

texts: I need to add a mask to telephone on a checkout page, like +9-(999)-999-99-99.


texts: Sort Order of Products in Category Grid View by View Count

texts:
I've been trying to create a solution to this for some time now, and have been to the ends of the internet and back, maybe I missed something.

What I am trying to do is sort the product collection in the category list or grid view by product view count (sort by Popularity). I've looked into Mage_Reports_Model_Resource_Report_Collection but I don't think this will achieve what I am trying to do here. Is there a filterable product attribute that I can create that will allow this type of sorting? Or should I look at overriding setCollection() in Mage_Catalog_Block_Product_List_Toolbar? Or maybe there's another way to do this that I haven't thought of yet.

As far as I understand getAvailableOrders() will get a list of allowed sort orders based on what is set in the Admin panel, but I can't quite figure it out from there.


texts: Magento 2 : How to override admin panel product grid

texts:
I want to filter the products according to product attribute..
is there any any way that i can do it from custom module and override the whole magento 2 admin panel product grid.


texts:
Is it possible to create a Magento extension with a camelcase in the namespace?

Something like SmashingMagazine_Wishlist, I saw this article doing it The Basics Of Creating A Magento Module.

But would this cause any problems with the Mage AutoLoader?


texts: Opening product from category url is much slower than loading it from product url

texts:
So I have a product named A. If I open A from it's own url

  https://mymagentowebsite.com/A.html

it opens fast because it's cached.

However, if I open the product from the category url

  https://mymagentowebsite.com/category1/category2/category3/A.html

It takes much time (like 8-10 seconds) and eventually redirects to

  https://mymagentowebsite.com/A.html

Which could be the causes of this issue and what can I do to fix it?


texts:
I have my site up and running but I am unable to get the checkout to work and I know why, but I do not know the fix.

<?php if($themeConfig->get("enable_ajaxcart")) { ?>
<script type="text/javascript">
        var ajaxCart = true;
</script>
<?php } ?>
<script type="text/javascript">
    var minicart_url = "<?php echo Mage::helper('ves_tempcp')->getMinicartURL(); ?>";
</script>

<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('calCustom/js/min/ecoWarrior.min.js');?>"></script>

The last two scripts are what run my menus however because they come after the getCssJsHtml() ?> it conflicts with my checkout however moving them before this stops my Menu from working and gets my checkout to work. I have heard of using the $.noConflict(); but I'm not getting anywhere and cant fathom it out.

The line causing the issue is getSkinUrl('calCustom/js/min/ecoWarrior.min.js');?>">

Can anyone offer any insight?


texts:
I have create a custom admin action for a  custom admin controller and have allow to this action for acl.

But till now, ACL is not working

Controller:

<?php
class Amit_HelloAdmin_Adminhtml_HelloadminController extends
Mage_Adminhtml_Controller_Action
{

 protected function _isAllowed()
    {

        $action = strtolower($this->getRequest()->getActionName());
        if($action == 'search') {
                 return Mage::getSingleton('admin/session')
                    ->isAllowed('helloadmin/manage/search');
        }
        return parent::_isAllowed();;
    }

    //put your code here
    public function indexAction(){

        $_gotoSection =$this->getRequest()->getParam('gotosection');
        $this->loadLayout();
        $this->_setActiveMenu($_gotoSection);
        //$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Promotions'), Mage::helper('adminhtml')->__('Promo'));
        $this->renderLayout();

    }

   public function searchAction()
    {

    }
    public function helloAction(){

        echo "how";

    }

}

adminhtml.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <menu>
        <helloadmin translate="title" module="helloadmin">
            <title>Admin Theme</title>
            <sort_order>41</sort_order>
            <!-- action>adminhtml/helloadmin/</action -->
            <children>
                <manage translate="title" module="helloadmin">
                    <title>Manage theme</title>
                    <action>adminhtml/helloadmin/</action>
                    <sort_order>0</sort_order>
                </manage>
            </children>
         </helloadmin>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <helloadmin translate="title" module="helloadmin">
                        <title>Admin Theme</title>
                        <sort_order>40</sort_order>
                        <children>
                            <manage translate="title">
                                <title>Manage theme</title>
                                <sort_order>0</sort_order>
                            </manage>
                        </children>
                    </helloadmin>
                </children>
            </admin>
        </resources>
    </acl>
</config>

My Question: why searchAction  url is  not working as i have already add
  return

Mage::getSingleton('admin/session')
                        ->isAllowed('helloadmin/manage/search');

Please help me to shot out this thing?


texts: How to integrate theme from html to magento

texts: How to make custom theme in magento from html pages like as i have html theme. I want to integrate html to magento.


texts:
I committed my project files from one development member finely. When another developer tried to pull files and push his changes to git. It is adding some code. For example bootstrap.php file the following
<<<<< HEAD is added.

<<<<<<< HEAD
error_reporting(E_ALL);
ini_set('display_errors', 1);
=======
ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
error_reporting(E_ALL);
>>>>>>> 8ee88031045329aa9e3793e7ee1352f9750118c1

How to remove these <<<<<

We are following below commands to commit files in git.

git init

git config --global user.email "myemail@gmail.com"

git remote add origin https://web.com/web.git

git config --global http.sslverify false

git push --set-upstream origin master

git pull --rebase

git pull https://web.com/web.git master

git pull origin master --allow-unrelated-histories

It is a private repo. What was wrong in these commands.? Please help me.


texts: Magento 1.8 - can't use backend after upgrading extensions

texts:
I setup a fresh magento installation (1.8) and upgraded all extensions to their latest stable versions via Magento Connect Manager just moments after the installation. However, after it finished, I can't use the backend anymore.

It says: "Fatal error: Call to a member function setActive() on boolean in A:\wamp\www\magento\app\code\core\Mage\Adminhtml\Controller\Action.php on line 111"

Caching is disabled and I already cleared the folder "var/cache".

How can I use the backend again?

Thats the code from the error:

/**
 * Define active menu item in menu block
 *
 * @return Mage_Adminhtml_Controller_Action
 */
protected function _setActiveMenu($menuPath)
{
    $this->getLayout()->getBlock('menu')->setActive($menuPath);
    return $this;
}


texts: inserting an image in owl slider in magento

texts:
I want to insert an image in following code

jQuery(document).ready(function() {

jQuery("#owl-test-feature").owlCarousel({

navigation : true,

slideSpeed : 400,
paginationSpeed : 400,

items : 5,
itemsDesktop : false,
itemsDesktopSmall : false,
itemsTablet: false,
itemsMobile : true,
  navigation: true,
  navigationText: ["here prev.png","here next.png"]

});

});

I can't give media link inside the jquery.
can anyone help me?


texts: Remove tax caculation based on attributes in customer model

texts:
I have a custom attribute added to the customer model indicating weather we want to apply the tax or not. That attribute returns a boolean. I want to intercept in the way of where magento applies tax rules to the quote object & remove the tax rules if the attribute is set.

As far as i could understand Mage_Tax_Model_Sales_Total_Quote_Tax::collect is the one responsible for calculating taxes & setting them onto quote object. I think re-writing it might be able to somehow exclude that quote from taxes. but don't know how to proceed from here.

Also maybe the event sales_quote_collect_totals_before or sales_quote_collect_totals_after called from inside Mage_Sales_Model_Quote::collectTotals should be able to work. These events pass on the quote object itself. But again i don't know how to proceed.

Any pointers?


texts: Error while editing/ reseting customer password

texts:
When I try to edit customer password through admin - customers magento is giving me error- Invalid transactional email code:

No email template was added or changed on the website.


texts: Magento2 - Custom product attribute in product collection

texts:
I've created a new product attribute 'brand'. This attribute is within my default attribute set. Now I'm trying to get all brands from a product collection within a category.

I'm fetching the product collection:

$products = $this->_productCollectionFactory
    ->addAttributeToSelect('brand')
    ->addCategoryFilter($activeCategory)
    ->load();

But the brand is not displayed? The attribute brand is just a simpel text attribute. How can I fetch all brands from this collection?

Thanks


texts: Magento 2 - Post order details to third party payment method

texts:
Below is my payment-method.js

    define(
    [
        'jquery',
        'Magento_Checkout/js/view/payment/default',
        'Magento_Checkout/js/model/quote'
    ],
    function ($, Component, quote) {
        'use strict';

        return Component.extend({
            defaults: {
                template: 'NameSpace_CustomPayment/payment/testpayment'
            },

            placeOrder: function () {
                console.log(quote.billingAddress());
                $.mage.redirect('https://www.thirdparty.com');

            },

            getMailingAddress: function() {
                return window.checkoutConfig.payment.checkmo.mailingAddress;
            }
        });
    }
);

How can I post data of my quote object to third party.

Below is the sample Image to elaborate my query:


texts:
Does anyone know the handle/block name for the header search? I'd like to move it.

Also, is there a reference anywhere online for all the default elements?


texts: Magento 2 in how to remove the duplicate attributes?

texts:
I will Try to remove that but its not Working?

How to solve this ?


texts: How to list all the products of a paticular attributes in CMS page magento 2

texts: I need to display All the products by a specific product attribute in CMS page.


texts: Unable to add Pixiemedia_ImageCarousel extension to cms page

texts:
I have successfully installed Pixiemedia Image Carousel extension from the magento marketplace and made a group and added images in that. The next step should be to add that in any block or page (as per the description in the official Pixiemedia page). But I could not find any instruction on how exactly to do that.

(I am guessing it should be something like {{block ... etc)

Below is my default.xml:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2017 Pixie Media. All rights reserved.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="PixieMedia_ImageCarousel::css/pixiemedia-imagecarousel.css" />
    </head>
    <body>
    </body>
</page>

The folders I can see in the installed directory, i.e. C:\xampp\htdocs\magento2\vendor\pixiemedia\image-carousel is as follows:

Any help is appreciated and Thanks in advance!


texts:
Hi i use csv file to "import"  bulk products. Checking Data with no error.
but when i import the csv file, " Decoding failed: Syntax error"come out if anyone know why ?


texts: Find block name without template hints for block whitelist

texts:
I'm getting battered by the new block whitelist, because I don't actually know what my blocks are called.

Is there a reliable method of finding block names without template hints?

Edit: I should say, I don't have an explicit block in any XML files that I can find.


texts:
I'm trying to implement a custom payment module and have added a few custom colums to the sales_flat_order_payment table. After the customer places the order, these fields should be updated and some of the inserted information needs to pre presented simultaneously. I do all of this in a custom block, that should display a custom template file or an error message if something went wrong. The problem I'm having now is, that the database information doesn't get updated. I don't know if this is the right way to do it but here is my code:

 $this->orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
 $this->order = Mage::getModel('sales/order')->loadByIncrementId($this->orderId);
 $this->payment = $this->order->getPayment();

then later I try to assign my data to the fields, for example:

 $this->payment->setMyData(time());

the column names are all correct, in this case it would be my_data. I do the same with the appropriate get() methods, which seem to work ok.

Also there seems to be another problem, the error message in the constructor doesn't get displayed every time:

if($this->establishGateway() == true)
            {
              $this->setTemplate('mypayment/gateway.phtml');
            }
            else
            {
               Mage::getSingleton('core/session')->addError(__('There was a Problem with the Payment Gateway.'));

            }

loadlayout and renderlayout get called from the controller that loads this block. Any suggestions?


texts: How to get value of custom attribute of product in observer?

texts:
I have created a sales_order_save_after event observer. i will show the code below

  SalesOrderSaveAfter.php

public function execute(\Magento\Framework\Event\Observer $observer)
{
    //get the order object
    $order = $observer->getEvent()->getOrder();
    if ($order instanceof \Magento\Framework\Model\AbstractModel)
    {
        //get status
        $new_status =   $order->getStatus();
        //check the new status is confirm or canceled

        if ($new_status == 'confirm' || $new_status == 'canceled')
        {
            //parameters = array()
            $params         =   array();
            $order_id       =   $order->getId();
            $customer_id    =   $order->getCustomerId();

            if( !empty($order_id) ) {
                $product_ids = array();
                foreach( $order->getAllVisibleItems() as $item ) {
                    $product_ids[] =    $item->getProductId();
                    $product       =    $item->getData();
                    //$nrv         =    $item->getProduct()->getAttributeText('nrv');

                }
            }

            //$nrv = Mage::getModel('catalog/product')->load($product_ids)->getAttributeText('nrv');

            $params     =   array(
                'order_id'      =>  $order_id,
                'customer_id'   =>  $customer_id,
                'product_id'    =>  $product_ids,
                'status'        =>  $new_status,
                'product'       =>  $product,
                //'nrv'         =>  $nrv,
            );
        }

        //call the curl
        $this->curlCall($params);

    }
    return $this;
}

Everything is working correctly. Am getting All the information except custom attribute. I added custom attribute nrv to each of the product.
but i didn't get value of custom attribute. How can I get the custom attribute value in observer?. Thanks in advance for your valuable answer.


texts: Magento 1.9 - Why different Product URL for different Store

texts:
I have 1 website, 2 stores, and 1500 products.
All products assigned to both stores.

Why every product has different URL for each store?

I tried to truncate core_url_rewrite table and re-index again. But still, each product has different URL for the store.

Ex:

Product = ABC (SKU = ABC)

Product URL in Store1: abc.html

Product URL in store2: abc-1.html


texts:
Sometimes my magento 2 store returns this error

"Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in /var/www/vhosts/domain.net/httpdocs/magento2/vendor/magento/framework/Session/SaveHandler.php on line 110

it appear randomly and hard to reproduce unless it appear again. help me to solve this issue


texts: How to install Magento 2.3 on Windows 10 x64 with sample data?

texts:
I am a .NET Developer and for the first time installing Magento 2.3  on my local machine with Windows 10 , 64 bit machine from last three days but without success.

Here is what I did -

Installed XAMPP from here https://www.apachefriends.org/download.html
Downloaded , unzipped and copied the magento files to C:/xampp/htdocs/magento23 folder
From XAMPP> Apache > Config , uncommented the extensions soap, xsl, mysql and almost every other extension
Installed Composer and executed the composer install command in magento23 folder
Removed read-only permission from the complete folder
Readiness check, installation, DB Creation done. But the admin screen comes up complete gray and application screen come up with only few links at the bottom.


texts: How to disable magento to go on maintenance mode while installing the extension

texts:
I am trying to disable the Put store on the maintenance mode while installing/upgrading/backup creation under Magento connect in Magento admin.But I am unable to do that?

Is it possible to disable this feature, if yes how?


texts: How can i install two sample data theme in single magento panel

texts: I need to import sample data through .sql sample data file. For my second store with same magento admin, so where i can import my sample data in wamp. How can i import sample data ?


texts: How to make the content inside "gift options" be open when entering the cart?

texts:
Hi I´m editing this file: vendor/magento/module-gift-message/view/frontend/web/template/gift-message.html

Is there a way to make the content inside the div with the class "gift-item-block" opened by default?

Here is the code:

                            <button type="submit"
                                    class="action action-edit"
                                    data-bind="attr: {title: $t('Edit')}, click: $data.editOptions.bind($data)">

                            </button>
                            <button class="action action-delete"
                                    data-bind="attr: {title: $t('Delete')}, click: $data.deleteOptions.bind($data)">

                            </button>

Thank you!


texts:
We want to determine whether a product is in Category ID 2 or not. In Mage1 we were able to get all configured Categories when being in the $_product collection. In Magento2 it seems that there is no possibility to check what categories the product is configured to.

Is there a workaround for this? I've found a tutorial that says I need to inject something in the Block, but this does not work. See code below.

<?php
namespace ASDF\CurrentCat\Block;
class CurrentCat extends \Magento\Framework\View\Element\Template
{
        protected $_registry;

 public function __construct(
 \Magento\Backend\Block\Template\Context $context,
 \Magento\Framework\Registry $registry,
 array $data = []
 )
 {
 $this->_registry = $registry;
    parent::__construct($context, $data);
 }

 public function _prepareLayout() {
    return parent::_prepareLayout();
 }

 public function getCurrentCategory() {
     return $this->_registry->registry('current_category');
    }

 public function getCurrentProduct() {
     return $this->_registry->registry('current_product');
    }
}
?>

Especially the second function (getcurrentProduct()) doesn't work.


texts: Magento 2 How can I add unit of the data in the ui form field?

texts:
I need to indicate the user that the  “unit” of the data to be input, such as currency.

I am using ui component form. How can I achieve it?

Here is my code

<field name="total">
     <argument name="data" xsi:type="array">
         <item name="config" xsi:type="array">
             <item name="label" xsi:type="string">Amount</item>
             <item name="visible" xsi:type="boolean">true</item>
             <item name="dataType" xsi:type="string">text</item>
             <item name="disabled" xsi:type="boolean">true</item>
             <item name="formElement" xsi:type="string">input</item>
             <item name="source" xsi:type="string">total</item>
             <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
             </item>
         </item>
     </argument>
 </field>


texts: It is impossible to deduce a custom product options

texts:
i have product in catalog list:

i have custom options in details page:

how i can output custom option in catalog page:

i need is same options display in catalog page, options will be is same how and in product list

Thanks for the help!


texts:
I have two custom attributes for categories. The code for both is similar apart from the attribute_code but one is not being saved when trying to add a value in adminhtml.

That's the UpgradeData.php where I add the attribute that's not saved:

$eavSetup->addAttribute(Category::ENTITY, 'megamenu_side_block', [
    'type' => 'text',
    'input' => 'textarea',
    'label' => 'Menu Side Block',
    'required' => 0,
    'user_defined' => 1,
    'wysiwyg_enabled' => 1,
    'is_html_allowed_on_front' => 1,
    'global' => ScopedAttributeInterface::SCOPE_WEBSITE,
]);

That's the part of category_form.xml where I create the adminhtml field:

<field name="megamenu_side_block" template="ui/form/field" sortOrder="51" formElement="wysiwyg">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="wysiwygConfigData" xsi:type="array">
                <item name="settings" xsi:type="array">
                    <item name="theme_advanced_buttons1" xsi:type="string">bold,italic,|,justifyleft,justifycenter,justifyright,|,fontselect,fontsizeselect,|,forecolor,backcolor,|,link,unlink,image,|,bullist,numlist,|,code
                    </item>
                    <item name="theme_advanced_buttons2" xsi:type="boolean">false</item>
                    <item name="theme_advanced_buttons3" xsi:type="boolean">false</item>
                    <item name="theme_advanced_buttons4" xsi:type="boolean">false</item>
                    <item name="theme_advanced_statusbar_location" xsi:type="boolean">false</item>
                </item>
                <item name="files_browser_window_url" xsi:type="boolean">false</item>
                <item name="height" xsi:type="string">250px</item>
                <item name="toggle_button" xsi:type="boolean">true</item>
                <item name="add_variables" xsi:type="boolean">false</item>
                <item name="add_widgets" xsi:type="boolean">false</item>
                <item name="add_images" xsi:type="boolean">false</item>
                <item name="add_directives" xsi:type="boolean">false</item>
            </item>
            <item name="label" xsi:type="string" translate="true">Megamenu Side Block</item>
            <item name="source" xsi:type="string">category</item>
            <item name="template" xsi:type="string">ui/form/field</item>
            <item name="wysiwyg" xsi:type="boolean">true</item>
            <item name="dataScope" xsi:type="string">megamenu_side_block</item>
            <item name="rows" xsi:type="number">8</item>
        </item>
    </argument>
</field>

What I already checked:

The attribute is added to the table eav_attribute
When I debug into \Magento\Catalog\Controller\Adminhtml\Category\Save::execute() the value is there and after $category->save() I can still get the value with
$category->getMegamenuSideBlock()
I tried to add a value manually but it didn't work either it wasn't loaded in backend
When I change dataScope in xml to the attribute_code that is working the other attribute value is loaded just fine

As I said before I have a second attribute that uses the same code as above (just with different attribute_code) and that is working perfectly fine.

I've already checked several posts here but I didn't see any difference to my code or it didn't work.

What could be the reason that it's not saved to the database? Am I missing something in my code?

Update:
As @Alex suggested I tested it within 98-magerun2 dev:console but one is being saved properly into database the other one not.


texts: How to migrate only orders with Data Migration Tool?

texts:
I want to migrate ORDERS from magento1.

What i already achieved:

Migrate all data(customers,orders,products,categories,settings etc)
Migrate ONLY Customers

Main objective to know config steps which will migrate only orders. OR both Orders and customers.


texts:
I want to edit customer address section. (To change the required
  fields and field names). Where is the file location to make this
  change? I have enabled admin path hints. But was not able to succeed.
  My Magento version is 2.1.8.

  http://i.prntscr.com/K8hC3aNuRmqn6TEOQll8QQ.png

  Please help.


texts: Change product page to show Upsells on right side

texts:
I'm busy with a webshop for selling flowers and my customer want's to have the product page layout like the example below.

I need some ideas on how to change the layout but not sure where to start.

Any ideas on how to get the layout to show 2 or more upsells like the example?


texts:
I have two stores, one from San San Antonio and another one Detroit. I will get the details from the customer,

I am using FedEx and UPS,

Supposed user select San Antonio, San Antonio based shipping charges display to the customer (This my current process) if customer select Detroit, Detroit based shipping charges display to the customer(Need to configure).

My one of the store running in San Antonio, so shipping charge display to the customer.

My another store will be open on next month in Detroit, so how can display shipping charge based on Detroit, because my pickup point Detroit(By Default my store display San Antonio based pickup charge to customer )

How can I add two pickup address charges method to the customer, if customer select San Antonio, display San Antonio based shipping charge (current process working fine), also how can I display  Detroit pickup shipping charges to the customer?

  How can I configure more than one pick up address?


texts: How to get the current post being viewed from the aw_blog extension

texts:
I have the following code in template/page/html/head.phtml, and for social network sharing I need access to the blogpost content so I can extract the images from the blogposts.

$post = Mage::getSingleton('blog/cat')->load(Mage::app()->getRequest()->getParam('post_id', Mage::app()->getRequest()->getParam('id', false))))
$page = $post->getContent();

but this doens't give me the content of the current blogpost being viewed.


texts:
I have installed and then uninstalled maintenance site extension for my site,
but now some ip addresses can't have access to my site, does flush cache storage may solve this (does with the flush my site will work like it should ?) Please help me with this.


texts: Magento 2.1 : How to create dynamic custom header link without using cacheable = false

texts:
The cacheable = false works fine, but fpc gets completely disabled and pages are too slow.

Here is the default.xml

<referenceContainer name="header.panel">
    <block class="Custom\Mod\Block\Account\SponsorHeader" name="float.sponsor"  template="account/sponsor.phtml" >
        <arguments>
           <argument name="css_class" xsi:type="string">header links</argument>
         </arguments>
    </block>
</referenceContainer>

Is there any other way without using cacheable = false ?


texts: Retrieved compared products list in homepage

texts: I like to retrieve compared product collections in homepage template. Is there any method to retrieve the data?


texts: Update product programatically (setDescription) Error Object of class stdClass could not be converted to string

texts:
Hello I would like to set the Description for magento products using data collected from Amazon api. I am calling the API and would like to get the xml response into magento description. I have some code prepared which works:

<?php
 require('../AmazonApi.php');
 require_once ('../app/Mage.php');
 Mage::app();

 //Create API access object
 $public_key = '*************';
 $secret_key = '*************';
 $associate_tag = '**********-21';
 $amazon_api = new AmazonAPI($public_key, $secret_key, $associate_tag);

$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('asin')
->addAttributeToSelect('description');

//Array of request parameters
foreach($products as $product)
{
$asin = $product->getAsin();
$product->setDescription($response);
$product->getResource()->saveAttribute($product, 'description');
$params_array = array(
'Operation' => 'ItemLookup',
'IdType' => 'ASIN',
'ItemId' => $asin ,
'ResponseGroup' => 'Tracks');

// returns a list of items for the search query 'Slow Magic'
$response = $amazon_api->sendRequest($params_array);

foreach ($response as $restponse)
{
sleep(1);
}

echo '<pre>';
print_r($response);
echo '</pre>';
}

foreach($parsed_xml->OperationRequest->Errors->Error as $error){
 echo "Error code: " . $error->Code . "\r\n";
 echo $error->Message . "\r\n";
 echo "\r\n";
 }

The code is correct the only problem with is the response, the error I am getting in the logs is:

  Object of class stdClass could not be converted to string   Object of class stdClass could not be converted to string.

Any how to convert to a string?


texts: Folder structure differs in magento2 and magento 2.0.2

texts:
I downloaded magento 2.0.0 by cloning from github. In that the folder structure is like app/design/frontend/magento/luma & blank. And every module is defined seperately in luma and blank theme.Now when I downloaded magento 2.0.2 from https://www.magentocommerce.com/download the folder structure is different. root_folder/vendor/magento contains all the modules and the frontend and adminhtml are present inside view folder. And it is empty inside app/design/frontend/magento/. Someone kindly explain where to create the custom theme. Like in 1.9.x we usualy duplicate rwd/default to create custom theme. Same way what should be duplicated here and inside which folder it should be duplicated? Someone please explain the concept.

Also at cloned magento 2.0.0 backend when I select store/configuration->general->design It is displaying something like search engine robots Below is my screenshot

Where to select the theme?


texts: I want to change the url for mobile user to m.mysite.com with same mobile view look in browser

texts: I need my site www.mySITE.com to open as m.mySITE.com on mobile devices. It has SSL set up also. Please share the code and file name as I do not have any coding knowledge.I want to display the same theme as it is looks like now, only need to change the url.


texts: how to import product images programmatically in magento 2?

texts:
How to import product images programmatically using csv.

In my csv I mentioned the product sku,base,small images names.

Overall there are 4000 products are there.

Please help me out of this.

I done through admin as explained in http://docs.magento.com But still no luck.


texts: Adding custom attributes to states and a dropdown to cities

texts:
I would like to change the way the users enter addresses, and I have several doubts about the best way to do it.

First, I need to add a drop down for states/provinces to other countries, for what I've seen this is completely database work. Is this correct?

I also need that instead of typing the city, the user gets to select the desired city from a select input. I suppose this would be achieved by creating a new model with its table, and such table is related to the states/provinces. I think this is the right way to do so.

Then, I also need to add some custom attributes to the states, a special code. I don't think I can use EAV, for what I've seen states is no extensible. Do I have to modify the table (or add a new table that references state) to add the new attributes? or is there a simpler way to implement this?

Thanks.


texts: Magento: Setting the first order number issued

texts:
When completing the first order placement at a Magento store
the order number issued by default is 100000001. I would like
to set is to something smaller (since there aren't that many
items in the store) and would also like the number to be
more random-looking (for instance 576). The reason is
that I don't want customers knowing they are the first
customer and would rather they thought there had been
other orders before theirs. I think it would make
the store more discreet.

Is there a way to set the first order number
value returned in the following message,
prior to a store's launch? Here is
what my test instance of the
frontend displayed upon
placing the very first
order:

Your order has been received.
Thank you for your purchase!

Your order # is: 100000001.

You will receive an order confirmation email with details of your order and a link to track its progress.

Thanks.


texts: Magento 2 describe attrubute property used in Plugin method

texts:
I am trying to create a simple module and I can't find the propose of the attribute name and type inside the tag type and plugin in di.xml.
can anyone describe attribute name used in plugin?

<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="???">
        <plugin name="???" type="???" sortOrder="1"/>
    </type>
</config>

The documentation is not so clear for a beginner.


texts:
I am trying to retrieve all the featured product like this in my .phtml block:

$collection = Mage::getResourceModel('catalog/product_collection')
                           ->setStoreId(Mage::app()->getStore()->getId())
                           ->addAttributeToFilter('featured_product', array(1))
                           ->addAttributeToFilter('status', array(1));

But i keep getting an error like this:

  PHP Fatal error:  Uncaught Error: Call to a member function
  getBackend() on boolean in
  /var/www/gv/app/code/core/Mage/Eav/Model/Entity/Abstract.php:816\nStack
  trace:\n #0
  /var/www/gv/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1377):
  Mage_Eav_Model_Entity_Abstract->isAttributeStatic('featured_produc...')\n#1
  /var/www/gv/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(321):
  Mage_Eav_Model_Entity_Collection_Abstract->_getAttributeConditionSql('featured_produc...',
  Array, 'inner')\n#2
  /var/www/gv/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php(1440):
  Mage_Eav_Model_Entity_Collection_Abstract->addAttributeToFilter('featured_produc...',


texts:
In google I see my store title have the following design:
Store name: more text
I've tried to look for where this colon is but can't find it or change it to something else.
Where is this done?
Also where do you change the link to sitemap in robots.txt? It looks like as default its in sitemap/sitemap.xml, and I can't change it, only add a second in robots.txt..
One last thing, I've added my updated sitemap (new website), but google search console tells me that it still seeing the old URLs etc.. Does this just take time for google to discover and crawl?
Thanks in advance.


texts:
We developed a new website in Magento 1 and have a little problem with TTFB (specially in checkout). Our host made some jQuery logs and he told us that every time you load any page the catalogue is loaded. This is the reason why we have enormous load times without the lesti cache. I attached you the log. How can we fix this?

link for query log:

https://www.dropbox.com/s/wn5ww0pxundde99/20171018-query.log?dl=0


texts: My directory structure is var/www/html and my website was installed in the html folder.  I created a new directory called myfirstwebsite so now the directory structure is var/www/myfirstwebsite.  I am doing this because I am trying to host two different websites using apache virtual host.  I updated the httpd.conf to directory root /var/www and added   Now the front page of the website loads perfectly fine, but the problem is none of the navigation links work (i get the error: requested url was not found on this server).  Anyone have any idea what could be wrong here? I could really use the help.


texts: Magento aggregate and between collections?

texts:
1) How to write the below SQL query in Magento collection :

SELECT * FROM 'table1' WHERE active=0 AND '2014-07-08' between 'not_available_from_date' and 'not_available_to_date'

2) Also how to write this SQL query in Magento Collection :

Select sum(qty + product_id - any_other_columns) as total from table2  GROUP BY product_id;

Without using ->columns('  ') function.

Thanks for your help


texts: Upsell: always shows custom text even when price is not 0

texts:
When I use this below code for my view.phtml page, when price is 0 then it shows a message, (Price on request). This works. When price is not 0 then it shows the price.

VIEW WORKS
/app/design/frontend/default/modern/template/catalog/product/view.phtml

<?php if($_product->price==0): ?>
     <?php  echo 'Price on request'; ?>
<?php else: ?>
     Price
     <?php echo $this->getChildHtml('product_type_data') ?>
<?php endif; ?>

When I use the code for my upsell.phtml I always get the message, (Price on request) while it needs to show a price when its not 0.

UPSELL DOESN'T WORK
/app/design/frontend/default/modern/template/catalog/product/list/upsell.phtml

<?php if($_product->price==0): ?>

Price on request

<?php else: ?>

<?php echo $this->getPriceHtml($_link, true, '-upsell') ?>

<?php endif; ?>

Does anyone knows how to solve this?

// extra info
I use special price allot, maybe something is wrong in the price.phtml ?


texts:
I am trying to get product prices both inclusive and exclusive tax in custom export script.

To get product price with inclusive tax I used this code.

Mage::helper('tax')->getPrice($_product, $_product->getPrice());

This working fine for simple product.

But For Bundle product how we can get price inclusive tax.

Bundle product price type is dynamic.

And I have used this code to retrieve bundle product price.

$bundlePriceModel = Mage::getModel('bundle/product_price');
 $selectionCollection = $_product->getTypeInstance(true)->getSelectionsCollection(
                      $_product->getTypeInstance(true)->getOptionsIds($_product), $_product
                  );

                  $itemPrice = 0;
                 foreach($selectionCollection as $_option) {
                            $itemPrice += $bundlePriceModel->getSelectionFinalTotalPrice($_product, $_option,1, $_option->getData('selection_qty'), true, true );
                            }


texts: Customer mini login form not working with form key

texts:
I have added a mini login for in topmenu using code

<?php echo $this->getLayout()->createBlock('customer/form_login')->setTemplate('customer/form/mini.login.phtml')->toHtml();

code of my mini.login.phtml file is

<form method="post" id="login-form" action="<?php echo $this->getPostActionUrl() ?>">
    <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />

            <input type="text" name="login[username]" title="<?php echo $this->__('Enter your Email-id to Login'); ?>" id="email"  class="input-text required-entry validate-email logintex" placeholder="Email-id"/>

            <input type="password" title="<?php echo $this->__('Enter your password here'); ?>" name="login[password]"   id="pass" class="input-text required-entry validate-password logintex" placeholder="Password"/>

            <a href="<?php echo Mage::getBaseUrl() . "customer/account/forgotpassword/"; ?>">Forgot Password?

            <input type="submit" class="submit" title="<?php echo $this->__('Click here to Login'); ?>" value="<?php echo $this->__('Sign In'); ?>"/>

</form>

The problem is that even after adding form key code , customer can not login from mini login form, the reason I found for this is form key is not valid.
I checked login form and mini login form have different formkey when I copied login page form key to mini login form it worked.

When I cleared all magento cache and session with browser's cookie and cache,  then both the form generated same formkey and mini login worked , but after some time when try to login from another browser (even in same browser and private browsing) the issue occurs again. is there any permanant solution or alternate way to login from mini login form?


texts: Product Images fail to load after Version upgrade magento 2.2.9

texts:
I tried to upgrade version 2.2.1 to 2.2.9 and for some reason images inside the product catalog on the frontend load forever.
I did research and tried all the below solutions

https://www.ctidigital.com/blog/fixing-image-resize-issues-after-upgrading-to-magento-2.1.6

https://support.weltpixel.com/hc/en-us/articles/360016052033-Pictures-Images-not-showing-in-category-page-after-updating-from-M2-2-x-to-Magento-2-3

Cleared product cache, magento cache - nothing works.

Does anyone have any suggestions?


texts: how to use mixin when the theme overrides the js component

texts:
I'm experiencing the following issue.

I have a theme which overrides the swatch renderer in

app/design/frontend/Vendor/Name/Magento_Swatches/web/js/swatch-renderer.js

I also have a module which adds a mixin for Magento_Swatches/web/js/swatch-renderer.js

However the function I'm wrapping is never executed.

 /*jshint browser:true jquery:true*/
 /*global alert*/
 define([
'jquery',
'mage/utils/wrapper'
 ], function ($, wrapper) {
'use strict';

return function (targetModule) {
    var updatePrice = targetModule.prototype._UpdatePrice;
    targetModule.prototype.dynamic = {};
    var updatePriceWrapper = wrapper.wrap(updatePrice, function (original) {
        // console.log('execute mixin');
        return original();
    });

    targetModule.prototype._UpdatePrice = updatePriceWrapper;
    return targetModule;

};
});

This is the theme's override

https://pastebin.com/xch5jwmH

Any ideas why I can't wrap the function? I also tried wrapping other functions of the component but it still never executes.


texts: Can't access login, checkout etc. I get 404

texts:
I have a second store with a different domain. I created the second store with symlinks. Everything worked fine, till I discovered I can't acces any pages that are using html templates. register.phtml, login.phtml and so on.

When I click in my store on checkout, login or register. I get an 404 error. Saying:

  The requested URL /checkout/onepage/ was not found on this server

Have anyone experienced this issue? How can I solve this.


texts:
I want to implement countdown watch which will be reset next morning at 11 am. Means in every morning at 11 am it should be reset automaticaly.

Below is the code which I implemented as hardcode, but now I want it dynamic, right now I am giving date of next day hardcode.
Can anyone please suggest how can I get dynimacaly date of next day, which should be in formate - Month(Feb) date(tommorow), year

<script>

// Set the date we're counting down to
var countDownDate = new Date("Feb 10 2017,  12:00:00").getTime();

// Update the count down every 1 second
var x = setInterval(function() {

    // Get todays date and time
    var now = new Date().getTime();

    // Find the distance between now an the count down date
    var distance = countDownDate - now;

    // Time calculations for days, hours, minutes and seconds
    //var days = Math.floor(distance / (1000 * 60 * 60 * 24));
    var hours = Math.floor((distance % (1000 * 60 * 60 * 12)) / (1000 * 60 * 60));
    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    var seconds = Math.floor((distance % (1000 * 60)) / 1000);

    // Output the result in an element with id="demo"
    document.getElementById("demo").innerHTML = hours + " : "
    + minutes + " : " + seconds;

    // If the count down is over, write some text
    if (distance < 0) {
        clearInterval(x);
        document.getElementById("demo").innerHTML = "EXPIRED";
    }
}, 1000);
</script>


texts: Dev/Staging/Live Cookie Domain For Non-www Sites

texts:
The live URL is http://shop.com. The development/staging URL is http://sub.shop.com. How do I have to set up the cookie domain, so that I can log into both admin areas without any interdependencies? I tried the following cookie domain settings, but none of them worked:

Live cookie domain: .shop.com
Dev  cookie domain: .shop.com
Result: Live login does not work.

Live cookie domain: shop.com
Dev  cookie domain: .shop.com
Result: Logging out from one admin area means that you are also logged out from the other admin area.

Live cookie domain: shop.com
Dev  cookie domain: sub.shop.com
Result: Dev login does not work.

Live cookie domain: .shop.com
Dev  cookie domain: sub.shop.com
Result: No login works.

Live cookie domain: shop.com
Dev  cookie domain: .sub.shop.com
Result: Dev login does not work.

Live cookie domain: .shop.com
Dev  cookie domain: .sub.shop.com
Result: No login works.

Of course, I have disabled the Magento cache and I clear the cookies in my browser before trying each setting.


texts: Magento 2: How to display thumbnail of the image when upload image without ui_component

texts:
I want to display preview/thumbnail of the image as per mention in image when i upload image in admin panel. How it is possible without ui_component?

Please help me.

Thanks in advance :)

$image11 = $fieldset->addField(
        'image',
        'image',
        [
            'name' => 'image',
            'label' => __('Background Image'),
            'title' => __('Background Image'),
            'tabindex' => 1,
            'onchange' => 'imagechange(this)',
        ],'text'
        );

I used dependency in this field..when I select background type image, then background image field will be show . But 'background image' label is not hide because of 'after_element_html'. How can i hide 'Background Image' label use with the use of 'after_element_html'


texts:
I want to know if i truncate catalog_product_link, Will it be filled again after reindexation ?
I'm trying to clean as some link between products are now obsolete.


texts:
In the table customer_entity the field "is_active" is included. As default the value ist set to "1".
How can I use/add this field in customer admin edit page?

Christian


texts: How does Magento2 Access Control List work?

texts: I have been looking over the internet for an exposition of access control lists in Magento2 and will appreciate any insight on this.


texts: How to activate product navigation in Magento 2?

texts:
Magento 2 product navigation (next and previous buttons) in the product details page are not working for me. I cannot find any settings to enable this feature. I explored the template to

  magento_home/vendor/magento/module-catalog/view/frontend/templates/product/view/type/default.phtml

and found the following script:

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

// @codingStandardsIgnoreFile

?>
<?php /* @var $block \Magento\Catalog\Block\Product\View\AbstractView */?>
<?php $_product = $block->getProduct() ?>

<?php if ($block->displayProductStockStatus()): ?>
    <?php if ($_product->isAvailable()): ?>
        <div class="stock available" title="<?php /* @escapeNotVerified */ echo __('Availability') ?>">
            <?php /* @escapeNotVerified */ echo __('In stock') ?>

    <?php else: ?>
        <div class="stock unavailable" title="<?php /* @escapeNotVerified */ echo __('Availability') ?>">
            <?php /* @escapeNotVerified */ echo __('Out of stock') ?>

    <?php endif; ?>
<?php endif; ?>

However, it is taking me nowhere. How to enable Next, and Previous buttons to the product details page to explore next and previous products?

I have found few tutorials on it, as this and this but they are all for Magento 1.x. I am confused whether this feature is available for Magento 2. Please confirm if you have implemented this feature successfully.


texts: How to change the text in checkout cart page in magento 2


texts: Magento2 get tax rate on product view page

texts:
I want to get tax rate (percentage) on product-view page. Following code only shows text of tax:

$currentProduct->getAttributeText('tax_class_id')

Thanks for help!
martn