texts: How to add classes input focused on checkout and product review forms?

texts:
If an input is in focus or has a value, I want to add a class to all inputs parent .field div. For example on the product page review form or on the checkout page shipping form. If the input is in focus I would add an "active" class and if the input has a value I would add the class "hasavalue."

When I try to use jquery, nothing happens on the product page review form inputs or on the checkout page inputs.

Here's the jquery I am using:

requirejs(['jquery'],function($){

$(document).ready(function(){

    $('.field input').focus(function () {
        $(this).parent().parent().addClass('active');
    }).blur(function () {
        $(this).parent().parent().removeClass('active');
    });

    $('.field input').blur(function(){

        if ( $(this).val() ) {
              $(this).parent().parent().addClass('hasavalue');
        } else{
            $(this).parent().parent().removeClass('hasavalue');
        }

    });

});});

Do I need to use knockout? If so, how can I translate this simple jquery to work with all inputs in Magento?


texts: I want to get the shipping cost for a specific order on magento 2 v2.2.4. What is the query I have to do?


texts: Call to a member function getId() on null date.phtml

texts:
I want to call a date.phtml template in catalog/product/view.phtml but i have the error: Call to a member function getId() on null in ...PATH line 28 and this line there is : <?php $_optionId = $_option->getId() ?>

I called it like this:

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/view/options/type/date.phtml')->toHtml(); ?>


texts:
I have created an extension to modify invoice PDF, in that want to add order comments. I am extending
Mage/Sales/Model/Order/Pdf/Invoice.php and Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php files.
 What is the method to fetch order comments. I have tried the following method

 $commentHistory =  $order->getStatusHistoryCollection(true);

Please help.


texts:
I have tried to run the command line script in a linux VPS with PuTTy and get this error:

  Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.

I tried to update php to 7.0.5 but

phpinfo() shows 7.0.5
in PuTTy php -v shows php version 5.4.1

How to run command-line in my VPS?


texts: How validate Order amount with payment made amount in Magento 2?

texts:
<?php

namespace PayUIndia\Payu\Controller\Standard;

ini_set('display_errors', 1);

class Response extends \PayUIndia\Payu\Controller\PayuAbstract {

    public function execute() {

        /*$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $neworder = $objectManager->get('Magento\Sales\Model\Order');
        $price = $neworder->getGrandTotal();*/
        //$testprice = $price==2000;

        $returnUrl = $this->getCheckoutHelper()->getUrl('checkout');
        $finalPrice = $this->getGrandTotal();

        try {
            $paymentMethod = $this->getPaymentMethod();
            $params = $this->getRequest()->getParams();

            if ($paymentMethod->validateResponse($params)) {

                     if(!$finalPrice){
                          $this->messageManager->addErrorMessage(__('Payment failed. Please try again or choose a different payment method'));
                $returnUrl = $this->getCheckoutHelper()->getUrl('checkout/onepage/failure');
                     }
                     else{
                $returnUrl = $this->getCheckoutHelper()->getUrl('checkout/onepage/success');
                $order = $this->getOrder();
                $payment = $order->getPayment();
                $paymentMethod->postProcessing($order, $payment, $params,$finalPrice);
            }
            }

            else {
                $this->messageManager->addErrorMessage(__('Payment failed. Please try again or choose a different payment method'));
                $returnUrl = $this->getCheckoutHelper()->getUrl('checkout/onepage/failure');
            }

        }catch (\Magento\Framework\Exception\LocalizedException $e) {
            $this->messageManager->addExceptionMessage($e, $e->getMessage());
        } catch (\Exception $e)  {
            $this->messageManager->addExceptionMessage($e, __('We can\'t place the order.'));
        }

        $this->getResponse()->setRedirect($returnUrl);
    }

}


texts: Session variable is not persisting to next request

texts:
Every frontend page load, I need to check for a certain url parameter, and if it is found I set a session variable to true so that I know at one point during this session the customer had this parameter in their request. Needless to say, this session variable must persist for the lifetime of the session.

I'm observing event controller_front_init_before and triggering this code:

    /** @var Mage_Core_Controller_Varien_Front $front */
    $front = $observer->getEvent()->getFront();
    $params = $front->getRequest()->getParams();

    /* Only set session var to true */
    if(isset($params["testutm"]) && trim($params["testutm"]) == "email") {
        Mage::getSingleton('core/session')->setIsFromMarketingEmail(true);
    }

Then, for testing, I am trying to retrieve this in a cms page that adds a block/template to the content block via layout xml:

<reference name="content">
    <block type="gbicm/modal" name="gbicmmodal" template="gbicm/modal.phtml" />
</reference>

So in modal.phtml, I have this line:

ifme - <?php var_dump(Mage::getSingleton('core/session')->getIsFromMarketingEmail());?>

This dumps null in every case, except if I request the cms page itself with the url parameter intact. Even if I take the parameter out of the URL and request again, I get null. Why is the session variable not persisting to the next page request?

On an interesting side note: I have a /test.php which the session variable does persist to:

require 'app/Mage.php';
umask(0);
Mage::setIsDeveloperMode(true);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::app()->loadArea('frontend');

var_dump(Mage::getSingleton('core/session')->getIsFromMarketingEmail());

This is always showing me my session variable as expected. Why does is it not set in my custom module block/template?

Update: Seems like the issue is where in the framework I'm setting the session variable. If I set it in the block, it persists as needed.


texts:
There are several modern ways to install Magento:

Magento as Puppet Module: cmuench/Magento-Vagrant-Puppet-Nginx or bippo/puppet-magento
Magento as Composer Dependency - so you create composer.json in your project and run composer install
Or run composer create-project "kylecannon/magento" -s dev

Probably 2-nd way is more flexible to watch for latest versions. But do we need all dependencies of magento-project (connect20/mage_all_latest) or better just to use archive of the latest release?

Which way to choose?


texts: Magento 2 Reindexing - One or more indexers are invalid. Make sure your Magento cron job is running

texts:
I couldn't find the way to do reindexing in mass actions on magento 2.

Seems like you need to run it from cronjob. Is there an alternative way to reindex data in magento 2 from backend or command line just like it used to be in Magento 1.x (php shell/indexer.php -reindexall) ?


texts: Magento 2 status invoice "not paid yet" instead of "paid"

texts:
If the customer selects the payment method "Invoice" and we create an invoice in admin, status is always set to "paid". But that is not correct, because the customer did not pay yet.

So how can I change the status of an invoice?


texts:
We are receiving an error when trying to import our product catalog via CSV.

General system exception happened
Additional data: Wrong request parameters

We also get the same error when trying to import the sample file generated by the import page (catalog_product.csv)

Our magento version is 2.0.2

Edit:  Upgraded to 2.0.4 this morning - still receiving the same error.
The strange thing is that validation seems to work, but we receive the "General system exception happened
Additional data: Wrong request parameters" on any file that passes validation, including the default sample file generated by the import page.  It seems like this may be some server setting interfering with request inputs, however, double checking the requirements everything seems to be in order.


texts: Is Any way to call $this of register.phtml file in login.phtml

texts: I want to merge both the file (login and Registration) in that did not get $this value for registration and page gonna be burst.


texts: How to write Unit Test for a function which uses a variable defined in Constructor

texts: I'm trying to write a Unit Test in Magento 2 which uses a variable defined in __construct(). The variable gets its value in another function. Thus when I run my test it gives me an error that the variable is null. How can I feed a value to that variable in my test to make it pass?


texts: How to get 6 random product from a catregory in magento 2

texts: I want to get 6 random product from same category on product page in magento 2


texts: Void and Cancel via backend for Authorize.net

texts:
Situation:
Client made an order, and choose Authorize.net as payment method
Within 24 hours he want to cancel it
Authorize.net has not yet settled the payment, and Cancel action from backend returns an error message
My task:
Create a void action
Problem:
As code investigation shows - default authorize.net payment method for magento have the same method for cancel and void. To be exact - cancel action refers to void action.
Question:
How to achieve void for payment in this situation, which will not return an error?


texts:
Magento 1.9 CE running on LAMP stack.

Users land on site initially and they are getting Magento's "please enable use of cookies" page. They refresh and it is gone. I confirmed this behavior for Chrome and Safari.

Some are saying this is the solution to prevent it: Go to System –> Configuration –> General –> Web –> Session Cookie Management –> Cookie Lifetime = 5400

However my cookie lifetime was already set much higher than that and if you refresh even once the cookie is gone - changing cookie lifetime is not the fix.

I know how to turn it off: Go to System –> Configuration –> General –> Web –> Browser Capabilities Detection –> Redirect to CMS-page if cookies are disabled = No

But I'm most interested in what is actually causing it.


texts: Unable to change/save any product attribute settings in admin panel

texts:
As per this bug report, I'm having an issue where I'm unable to save any changes to product attributes in the Magento 2 admin area.

When I try to change settings of any attribute and hit save, a POST request is made to (e.g.) https://example.com/admin/catalog/product_attribute/validate/attribute_id/200/?isAjax=true but it receives no response.

The page then reloads to a more basic URL of https://example.com/admin/catalog which results in a 404 error, and the changes are not saved.

There are no errors visible.

Please note I have tried clearing (and disabling) all caches, indexes, deployed static content, checked file/folder permissions, etc. and this is still happening.

Any ideas, please?


texts: Save Custom field in shipping address at Checkout in Magento 2

texts:
There is any simple way in Magento2 to add custom field to Checkout? I have displayed my custom field in shipping address following by StackOverFlow tips and Magento docs. Unfortunally, Magento docs doesn't have info how to save this attribute to database.

I have moved my attributes from custom_attributes to extension_attributes, but values still is not saved in customer shipping address.

Can You give me tip how I should save my new field in custom attributes in shipping address in Customer details?


texts: How to add the option value for the product attribute in magento2

texts:
How to give the option value for the product attribute programmatically.

I need to give the option value for manufacturer attribute drop down field.

I have created admin grid for manufacturer details.

I need to get the option value of manufacturer attribute is taken from custom admin grid.

How to do this.


texts: Magento 2 Hide non salable products from product listing including filters and search

texts:
I am using magento 2.3.5 version. Even though the salable qty of the product is 0 the products still appears on the product listing page. How can we hide the product for which salable qty is 0.
I have followed below approaches.
Approach 1 :-
Created event - (event.xml)
<event name="catalog_block_product_list_collection">
    <observer name="custom_stockstatusimprovement_catalog_block_product_list_collection" instance="Custom\StockStatusImprovement\Observer\AddStockStatusToProductCollection" />
</event>

Observer - AddStockStatusToProductCollection.php
<?php

declare(strict_types=1);

namespace Custom\StockStatusImprovement\Observer;

use Magento\Framework\{
    Event\Observer,
    Event\ObserverInterface
};
use Magento\CatalogInventory\Helper\Stock as StockHelper;
use Magento\InventorySalesAdminUi\Model\GetSalableQuantityDataBySku;

class AddStockStatusToProductCollection implements ObserverInterface
{
    /**
     * @var StockHelper $stockHelper
     */
    protected $stockHelper;

    private $getSalableQuantityDataBySku;

    /**
     * @param StockHelper $stockHelper
     */
    public function __construct(
        StockHelper $stockHelper,
        GetSalableQuantityDataBySku $getSalableQuantityDataBySku
    ) {
        $this->stockHelper = $stockHelper;
        $this->getSalableQuantityDataBySku = $getSalableQuantityDataBySku;

    }

    public function execute(Observer $observer) {

        $_productCollection = $observer->getEvent()->getCollection();

        if(count($_productCollection) > 0){
            foreach ($_productCollection as $_product) {
                $salable = $this->getSalableQuantityDataBySku->execute($_product->getSku());
                $salableQty = $salable[0]['qty'];

                if($salableQty <= 0){
                    $_productCollection->removeItemByKey($_product->getEntityId());
                }
            }
        }

        $observer->getEvent()->setCollection($_productCollection);

        // return $_productCollection;
    }

}

But with this approach, there is an issue with product count, filter & search.
Approach 2 :-
https://www.rakeshjesadiya.com/apply-custom-conditions-for-product-collection-in-magento-2/
Here I am not sure about how to pass salable qty logic in custom query
Can someone please guide me, how can we achieve the same.
Thanks


texts: Magento 2.4 REST API for Create Cart Not Working

texts:
I am trying to create the magento default REST API for add simple product to cart like this way.

First I generate the customer token with the use of this API Call.
https://www.domain.com/rest/default/V1/integration/customer/token
And it will successful return the token.

Now with the use of that token, I call another API to added the product to the existing cart like this :
https://www.domain.com/rest/default/V1/carts/mine/items
Headers:
Content-Type: application/json
Authorization: Bearer "CUSTOMER TOKEN"

And Pass the parameter as POST
{
    "sku": "PO-002",
    "qty": 1,
    "quote_id": "4"
}

And it always return the error like this :
{
    "message": "\"%fieldName\" is required. Enter and try again.",
    "parameters": {
        "fieldName": "cartItem"
    }
}

See the image :

Can any one help me here?


texts: (Magento 2) Modify Select.php in Vendor Module-Catalog

texts:
I want to override the "Select.php" file at: /vendor/magento/module-catalog/Block/Product/View/Options/Type/ but I'm not sure where to put the modified "Select.php" file. The only thing I changed was commenting out the "--Please Select--" line 47.

Where do I put the modified "Select.php" file?

I am using stock Magento theme.

Thank you.


texts: Magento 2 multiple stores problem using parked domains from old magento 1.9 site

texts:
Being unsuccessful in migrating a 1.9 multiple store site to Magento 2 i have set up a new install and manually imported and set up all the cats products etc etc.

The issue i have is that in magento 1.9 i have multiple stores using parked domains and i found very good help pages to guide me thro the process.

How ever in Magento 2 i can not find any help to set up my situation of parked domains

I could change from parked domain but as my old site is current do not what to change the parked domains and bring the old site down yet.

The issue lies in what the settings should be in index.php and .htaccess files

Any help or direction would be appreciated

index file from 1.9

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
switch($_SERVER['HTTP_HOST']) {
    case 'xxxx.com.au':
    case 'www.xxxx.com.au':
        $mageRunCode = 'xxxx';
        $mageRunType = 'website';
    break;

Mage::run($mageRunCode, $mageRunType);

xxxx being domain name


texts: How to force only one product per order?

texts:
I needed to force only one product per order and one amount.

The amount of the product already resolved, now need a solution for just one product per order.

A single product per application, the cart display only one product, where to buy the second notice that it is not possible to purchase more than one product per order


texts:
I want to resave all products programmatically. So I am trying to use the below code to achieve it. But the save method is not working in it. I have placed the code in the root directory of my Magento 1.9 installation. Can anyone kindly let me know how can I make it work?

<?php
set_time_limit(0);

// require magento core
require_once 'app/Mage.php';

// execute on admin store
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

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

foreach($products as $product) {
    echo $product->getData('sku') . '<br/>';
    // save the product
    $product->save();
}


texts:
I Have Created a custom payment method which enabled in admin and showing in

one-step checkout page, But on clicking the proceed order the order payment

is not redirecting to a success page, Can anyone help me in these

Thanks In advance


texts:
I decided to refactor one of my extensions. (because Philwinkle pointed out some "not very well written" code).
In the current version my extension has a db table that holds some values and a model and resource model associated to the table.
In the new version that table becomes obsolete. All the values will be moved to the config section.
I have doubts about how I should approach this. Should I drop the table and the model since so I won't have unnecessary data and code or should I leave them there for some kind of backwards compatibility?
I already have an upgrade script that moves the values from the custom table to the core_config_data table, but there is always the (very slim) chance that someone did some modifications to the extension, and dropping the table and the model might make their version of the extension incompatible after the upgrade?


texts: magento2 ordered product report showing blank while export CSV

texts: Is there any solution please share why order product Report is showing blank.


texts:
Hey I'm trying to add a menu item in the Magento 2 backoffice but I want to create sections like this (Elements & Design):

Here is my Arno/Blog/etc/adminhtml/menu.xml:

<menu>
    <add id="Arno_Blog::main" title="Arno Blog" sortOrder="100" module="Arno_Blog" resource="Arno_Blog::main"/>

    <add id="Arno_Blog::main_blog" title="Blog"  module="Arno_Blog" resource="Arno_Blog::main_blog" parent="Arno_Blog::main"/>

    <add id="Arno_Blog::posts" title="Manage Blog posts"  module="Arno_Blog" resource="Arno_Blog::posts"
         parent="Arno_Blog::main_blog" action="arno_blog/blog"/>

</menu>

I think I'm doing it right but I still don't get the 'Blog' section.


texts:
I've created a module and added a new frontend value to magento in order to display the Captcha on the product review page.

I've posted this into my form.phtml:

<?php echo $this->getChildHtml('form.additional.info'); ?>

This is the node in my captcha.xml:

<review_product_list>
    <reference name="review_form">
        <block type="core/text_list" name="form.additional.info">
            <block type="captcha/captcha" name="captcha">
                <reference name="head">
                    <action method="addJs"><file>mage/captcha.js</file></action>
                </reference>
                <action method="setFormId"><formId>product_review</formId></action>
                <action method="setImgWidth"><width>230</width></action>
                <action method="setImgHeight"><width>50</width></action>
            </block>
        </block>
    </reference>
</review_product_list>

On the frontend I can verifyt that mage/captcha.js is loaded (when removing the XML, its not => I assume its working so far).

However, there is no captcha. What am I doing wrong?


texts:
Does anybody know where I can find the template on the image below?

I need to add social buttons under login but I don't know where to find the template
I'm using RWD Theme of Magento Enterprise 1.4

Hope you can help me.


texts: How to display Catalog Price Rule Discount and Special Price Discount along with Cart Price Rule Discount?

texts:
I'm using Magento version 2.2.4.
Currently on view and edit checkout page, only Cart price rule discount is shown as below

How to show Catalog Price Rule and Special Price (added while adding a product in Admin panel) in same or another line on checkout index page?


texts: Backend: where to define dropdown attribute's list of values

texts:
I am trying to define attribute 'hello' with values 'hello1', 'hello2', and 'hello3'
in the Catalog -> Attributes -> Manage Attributes -> Add New Attribute. In the
"Catalog Input Type for Store Owner" field I enter "Multiple Select" but I am
unable to see where the place where I can enter the three values
'hello1', 'hello2', and 'hello3' is.

Can anyone please help with this simple question which I am guessing
must have an obvious answer?

Thanks.


texts: Magento 2 Paginate custom collection using ViewModel

texts:
Magento 2 encourages the usage of view models instead of filling the blocks with business logic.

  A view model is an abstraction of the view exposing public properties
  and commands. It allows developers to offload features and business
  logic from block classes into separate classes that are easier to
  maintain, test, and reuse. Use this approach anytime you need to
  inject functionality into template files and your code does not need
  to be backwards compatible with Magento 2.1.

Paginating a custom collection is pretty straight forward (ex: how to add pagination on custom collection in Magento 2), but is it possible to make use of the ViewModel approach instead of adding the code into the Block class?


texts: Add confirmed field to admin customer form

texts:
I've added the confirmed field with a

  view\adminhtml\ui_component\customer_form.xml:

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="customer">
        <field name="confirmed">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">customer</item>
                    <item name="label" translate="true" xsi:type="string">Confirmed</item>
                    <item name="sortOrder" xsi:type="string">210</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="dataType" xsi:type="string">select</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

The field is shown, but not with correct values, always the default one.
Now I need to change the customer retrieved data to get this field with Yes if the customer is already confirmed and No if not confirmed.

How can I process the data for the form?

EDIT: I have also created an observer (to set the correct value) using the

  customer_load_after in adminhtml/events.xml

<event name="customer_load_after">
    <observer name="customerLoad" instance="<Vendor>\<Module>\Observer\Backend\CustomerLoadObserver" />
</event>

For testing, I tried changing the customer firstname. But it only worked for the admin page title (in the h1 class="page-title"), the customer form fields still have the values from database.


texts: How to upgrade a jQuery library version?

texts:
The version of jQuery in lib is 1.14.0. I want to upgrade to 3.0.0.Tried making changes in theme require.js and keeping the new version file in web/js folder of theme, but, it's affecting other js which searches those files in wrong location.

For example in require i gave the path as js/jquery as it is web/js folder. But, the validate.js file loaction is changed to js/jquery/validate.js


texts: How Magento2 Checks If To Serve Request From Cache Or From DataSource?

texts:
Example: We have a Full Page Cached Category Page, How System Know Weather To Send Cached Data as a Response, Or Hit Database and Send response.
If it uses any cache tag, where does it check?


texts: Is there an API available to download a digital product?

texts: Magento provides a rich set of SOAP api calls to interact. Just wondering is there an API available to provide the customer Id and download a digital product under that customers account?


texts: How to set tier prices by percentage in magento?

texts:
Is there anyway to set up a tier prices by percentage of actual price rather than static price.

Example : A product have price $15 now in tier price i need to set 5% of price discount if the quantity is 5 or greater.

Update
I got an idea but doesn't know about the final step . so i am posting it here.

Steps :

I will create an extra field where the tier prices are set it will be a drop down where person can select the type of price i.e fixed or percentage.
With the every tier price of the product we store the "percentage or fixed" information in the database by creating an extra attribute.
Now here comes my problem how i can calculate tier price with the help of percentage attribute so that my custom tier price can come on product page ?
In other words i am not getting how magento calculates the final price.

It could be great help even if anyone can point me to some direction.

Thanks in advance


texts: Can we import images in Magento2 using URL via rest api

texts:
Currently, we can import images in Magento using Rest API where we need to provide base64 data.

We need to know can we import images in Magento 2 using image URL in rest API instead of sending base64 data?


texts: Automatically send Invoice & Shipment using Observer

texts:
I am trying to automatically send shipment email when an invoice is created for an order but I can't get me code to work...

Here is what I have:

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Modulename_Invoicer>
            <version>0.1.0</version>
        </Modulename_Invoicer>
    </modules>
    <global>
        <models>
            <invoicer>
                <class>Modulename_Invoicer_Model</class>
            </invoicer>
        </models>
        <events>
            <sales_order_save_after>
                <observers>
                    <sales_order_save_after_handler>
                        <type>model</type>
                        <class>invoicer/observer</class>
                        <method>implementOrderStatus</method>
                    </sales_order_save_after_handler>
                </observers>
            </sales_order_save_after>
        </events>
    </global>
</config>

And Observer.php

<?php

class Namespace_Invoicer_Model_Observer
{

    public function implementOrderStatus ($event)
    {
        $order = $event->getOrder ();

        if ($this->_getPaymentMethod ($order) == 'ccsave') {
            if ($order->canInvoice ())
                $this->_processOrderStatus ($order);
        }
        return $this;
    }

    private function _getPaymentMethod ($order)
    {
        return $order->getPayment ()->getMethodInstance ()->getCode ();
    }

    private function _processOrderStatus ($order)
    {
        $invoice = $order->prepareInvoice ();

        $invoice->register ();
        Mage::getModel ('core/resource_transaction')
            ->addObject ($invoice)
            ->addObject ($invoice->getOrder ())
            ->save ();

        $invoice->sendEmail (true, '');
        $this->_changeOrderStatus ($order);
        return true;
    }

    private function _changeOrderStatus ($order)
    {
        $statusMessage = 'Order has been updated';
        $order->setState (Mage_Sales_Model_Order::STATE_COMPLETE, true);
        $order->save ();
    }

}

I did follow this example from Inchoo if anyone has been able to get this to work please let me as I'm banging my head off of the desk...


texts:
I want to send a JSON string via API, and then parse the JSON in code.  I don't want Magento to try to convert my JSON parameter to a PHP object.

I'm trying to add this to the stock registry API.  Here's the code that I've added.

webapi.xml

<route url="/V1/products/stockItems/update/" method="POST">
    <service class="Magento\CatalogInventory\Api\StockRegistryInterface" method="updateStockItems"/>
    <resources>
        <resource ref="Magento_CatalogInventory::cataloginventory"/>
    </resources>
</route>

StockRegistryInterface.php

public function updateStockItems($stockItems);

StockRegistry.php

public function updateStockItems($stockItems)
{
   // do stuff
}

I'm posting to http://magento.test/rest/V1/products/stockItems/update using Postman.

Here is my request address and headers.

Here's my JSON body

{
   "stockItems": [
      {
        "item_id": 1,
        "product_id": 1,
        "stock_id": 1,
        "qty": 15
      },
      {
        "item_id": 2,
        "product_id": 2,
        "stock_id": 2,
        "qty": 15
      }
   ]
}

I'm getting the error

[2019-03-06 18:22:44] main.CRITICAL: Report ID: webapi-5c800ff4b4623;
Message: Class  does not exist {"exception":"[object] (Exception(code: -1):
Report ID: webapi-5c800ff4b4623; Message: Class  does not exist at
/var/www/magento2/lib/internal/Magento/Framework/Webapi/
ErrorProcessor.php:205, ReflectionException(code: -1):
Class  does not exist at /var/www/magento2/lib/internal/Magento/Framework/
Webapi/ServiceInputProcessor.php:162)"} []

How do I get Magento to let me pass my JSON into updateStockItems without trying to convert it to a Magento object?

Update

I can get it to work by passing my JSON as a string and then parsing that string into JSON in the PHP code.  If I use the following as the body of my request, it works.  But that seems like a dirty workaround.  Is there a better way of doing it?

{ "stockItems": "[ {\"sku\": \"SKU-1234\", \"quantity\": 1234}, {\"sku\": \"SKU-5678\", \"quantity\": 5678} ]" }

And here's my PHP code (getStockItemBySku is an existing Magento function within StockRegistry.php)

public function updateStockItems($stockItems)
{
    $json = json_decode($stockItems, true);
    $updatedItemCount = 0;
    foreach ($json as $productJson)
    {
        $sku = $productJson['sku'];
        $quantity = $productJson['quantity'];
        if ($sku !== NULL && $quantity != NULL)
        {
            $stockItem = $this->getStockItemBySku($sku);
            if ($stockItem !== NULL)
            {
                $stockItem->setQty($quantity);
                $this->stockItemRepository->save($stockItem);
                $updatedItemCount++;
            }
        }
    }
    return $updatedItemCount;
}


texts:
I'm trying to understand how Magento manages Recurring Profiles and orders associated with them.

I have some open questions about that:

Order:

How the subsequent "order" is created from a Magento merchant perspective? First-order is placed by end-user, What happens for subsequent schedules?

Invoicing:

How is the setup of the invoice? Do the invoices go to the customer directly from Magento?
What is the impact on re-ordered items for invoices?
How taxes are managed?


texts: Send Mail controller goes to 302 in Magento 2?

texts:
I have created a custom controller and the controller which is used to send mail goes to 302 in Magento 2.
So i think that's why i didn't receive any mail in my mailbox.
If it is correct please tell me why i didn't receive any mail ?
My controller file is
<?php
namespace Codextblog\Customemail\Controller\Index;

use Zend\Log\Filter\Timestamp;

class Post extends \Magento\Framework\App\Action\Action
{
const XML_PATH_EMAIL_RECIPIENT_NAME = 'trans_email/ident_support/name';
const XML_PATH_EMAIL_RECIPIENT_EMAIL = 'trans_email/ident_support/email';

protected $_inlineTranslation;
protected $_transportBuilder;
protected $_scopeConfig;
protected $_logLoggerInterface;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
    \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Psr\Log\LoggerInterface $loggerInterface,
    array $data = []

    )
{
    $this->_inlineTranslation = $inlineTranslation;
    $this->_transportBuilder = $transportBuilder;
    $this->_scopeConfig = $scopeConfig;
    $this->_logLoggerInterface = $loggerInterface;
    $this->messageManager = $context->getMessageManager();

    parent::__construct($context);

}

public function execute()
{
    $post = $this->getRequest()->getPost();
    try
    {
        // Send Mail
        $this->_inlineTranslation->suspend();
        $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;

        $sender = [
            'name' => $post['name'],
            'email' => $post['email']
        ];

        $sentToEmail = $this->_scopeConfig ->getValue('trans_email/ident_general/email',\Magento\Store\Model\ScopeInterface::SCOPE_STORE);

        $sentToName = $this->_scopeConfig ->getValue('trans_email/ident_general/name',\Magento\Store\Model\ScopeInterface::SCOPE_STORE);

        $transport = $this->_transportBuilder
        ->setTemplateIdentifier('customemail_email_template')
        ->setTemplateOptions(
            [
                'area' => 'frontend',
                'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
            ]
            )
            ->setTemplateVars([
                'name'  => $post['name'],
                'email'  => $post['email']
            ])
            ->setFrom($sender)
            ->addTo($sentToEmail,$sentToName)
            //->addTo('owner@example.com','owner')
            ->getTransport();

            $transport->sendMessage();

            $this->_inlineTranslation->resume();
            $this->messageManager->addSuccess('Email sent successfully');
            $this->_redirect('customemail/index/index');

    } catch(\Exception $e){
        $this->messageManager->addError($e->getMessage());
        $this->_logLoggerInterface->debug($e->getMessage());
        exit;
    }

}
}

Any help is appreciated.


texts: Magento 2: REST API not returning data for orders using CRON?

texts:
I am getting order details using REST API. For this, I have written one controller in my custom module. When I am calling that controller from browser, it's is returning response but when I setup CRON for that then it is not returning any response.

Is there any special setting from CRON for REST API? Please help me how to get data of order using REST API from CRON?


texts: Magento 2 Add custom product attribute to 'Recently Ordered Items' section

texts:
I want to add custom product attribute say "flavor" next to product name in "Recently Ordered Items" section.

I checked the phtml to see where the data comes from. lastOrderedItems().items is the answer.
To check further I opened last-ordered-items.js where it fetches data like this

this.lastOrderedItems = customerData.get('last-ordered-items');

Then I opened customer-data.js to check the get() function and I find this:

get: function (sectionName) {
            if (!this.data[sectionName]) {
                this.bind(sectionName);
            }

            return this.data[sectionName];
        },

My question is how do I debug further and know how it is actually fetching the data?


texts: How to get last added attribute option id in magento 2?

texts:
I am adding options to attribute programmatically as explained here http://webkul.com/blog/programmatically-add-options-attribute-magento2/.
What i want is to get the id of that attribute option to save it to my custom db table. How to achieve this?
thanks


texts: Magento 2.3.3 System Configuration Tab label Not Support Image Tag

texts:
In Magento 2.3.3 I add the following code to display the image in system configuration tab at Label  but now not display image only display image tag as a text.

<tab id="mytab" translate="label" sortOrder="110">
    <![CDATA[]]>
</tab>


texts: Magento 2 order create programmatically use ideal payment method but not working

texts:
I need payment method ideal and PayPal method set programmatically.
I have try many ways but still not working.
I have tried to cash on delivery it's working fine .but another payment method has try for that not wokring.
I have the following below link
https://www.mageplaza.com/devdocs/magento-2-create-order-programmatically.html
Thanks


texts: PHP Creating a credit memo from invoice number

texts:
Currently I am using the code below to refund a full order and create the creditmemo..

        $order = Mage::getModel('sales/order')->loadByIncrementId('100091904');
        $invoices = array();
        foreach ($order->getInvoiceCollection() as $invoice) {
            if ($invoice->canRefund()) {
                $invoices[] = $invoice;
            }
        }

        $service = Mage::getModel('sales/service_order', $order);
        foreach ($invoices as $invoice) {
            $creditmemo = $service->prepareInvoiceCreditmemo($invoice);
            $creditmemo->refund();
        }

But the problem is that the customer paid online with SagePay, this current method ONLY refunds this offline and as you can see this could be a very big problem, anyone got any ways to get around this? Would be much appreciated. Using Magento Enterprise ver. 1.12.0.2

I've not found anything on this before this purely REFUNDING online.


texts: Fedex International orders - commodity value

texts:
how to add a commodity value to each of the products in Magento. Because this is missing, we are not getting the correct shipping quotes from FEDEX for international orders. we have tried searching around the back end, but can't seem to find anything relating to this issue. Can anyone please let me know if you have a solution to this problem.

Thanks


texts:
I have set up my Magento hosting on Azure. I have 1 VM with 2 cores ( each of 2.14 GhZ), 3.6 GM RAM hosting apache and PHP code. Redis is set up as well.

Initially, this VM was hosting the SQL database as well, but after facing issues handling traffic, I moved my SQL database to a separate VM ( 1 core - 0.75 GB RAM).

I used this load testing online software - https://app.loadimpact.com

I simulated 50 VUs (gradually increasing from 1 to 50 within a minute).

I noticed that the load on the DB server never crossed 0.5

Meanwhile, the load on the apache + php server looked something like below -

For those unable to see clearly, the load average numbers are 48.27 23.75 12.81

This is just with 50 Virtual Users on the site.

Please advise how I should tackle this.


texts: How to write redirect script from Magento2 phtml page to another phtml page?

texts:
I want to write a script for redirection, i would like to write this script in Magento 2 header.phtml file, i have tried this below method but it is going to an infinite loop. Any one have any idea about this?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

$customerSession = $objectManager->get('\Magento\Customer\Model\Session'); $urlInterface
= $objectManager->get('\Magento\Framework\UrlInterface');

if(!$customerSession->isLoggedIn()) {
    $customerSession->setAfterAuthUrl($urlInterface->getCurrentUrl());
    $customerSession->authenticate(); }


texts:
is there a way to prevent Billing Address modification by all users?
After entering billing address in registration i don't want to let users modificate it.
Thank you very much.


texts: How can I get the collection of a custom module in magento 2

texts:
I am trying to create a custom module in M 2  0.74.0-beta16. How can I can get collection of custom table. I tried
$this->_mymodulemodelFactory->create()->getCollection();. The factory file is generated for my module but getCollection() gives noting.


texts: Implimenting a Content Security Policy Magento 1.9.x

texts:
I'm looking to improve the security of my site with a Content Security Policy. I have set one up for my site in htaccess (using Content-Security-Policy-Report-Only and doing everything possible to iron out what's required and then re-testing with the policy in place). I have good extensions and I'm relatively happy with the theme my site uses but I found that I had to add to my security policy for scripts the following:

script-src 'self' 'unsafe-inline' 'unsafe-eval'

and then to the image policy:

img-src 'self' data:

all my other policies are filled with either 'self' or analytics, google maps or captcha url's, the cdn url and a few extension url's (images in the back end configuration loaded from extension developers sites or site extension validation scripts etc).

What are the risks of 'unsafe-inline', 'unsafe-eval' and data:? How will these effect protection from cross-site attacks and if they do, which ones should I hunt down to get rid of so I can improve my content security policy?


texts: frontend-label not defined magento API V2

texts:
I'm getting an error: "Frontend-label not defined". This is my call:

 ini_set("soap.wsdl_cache_enabled", "0");
        $client = new SoapClient('http://magentosite/api/v2_soap?wsdl=1', array('cache_wsdl' => WSDL_CACHE_NONE));
        $session = $client->login('*****', '*****');

        $result = $client->catalogProductAttributeCreate($session, array(
            'attribute_code' => 'nieuw_code',
            'frontend_input' => 'select',
            'scope' => 'global',
            'apply_to' => array(
                'simple', 'configurable'
            ),
            'is_configurable' => '1',
            'is_visible_in_advanced_search' => '1',
            'is_visible_on_front' => '1',
            'additional_fields' => array(
                'key' => 'color',
                'value' => 'red'
            ),
            'frontend_label' => array(
                'store_id' => 'default', <-- tried numerous things here already
                'label' => 'Default' <-- tried numerous things here already
            ),
        ));

        var_dump($result);

In the API docs is this: "Notes: The "label" value for the "store_id" value set to 0 must be specified. An attribute cannot be created without specifying the label for store_id=0."

But I don't get what they mean with that?


texts: What we can achieve by unit test in Magento 2 ? How it is useful?

texts:
I don't know how can we do unit test of our module in Magento 2?

What will be benefits of doing a unit test on our Magento 2 module?

what will be the outcome of the unit test in Magento 2?

Which test method is standard in Magento 2 for custom modules?

Please explain briefly.

Thank in advance.


texts: Magento 2 admin grid module redirecting to dashboard

texts:
I have created a custom grid module in magento 2, It created a menu in admin panel, on click of menu, it is redirecting to dashboard and system.log has following errors :

...
[2017-07-01 04:11:57] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_391fccd54da687afc76a5d6559b714906 and handles default, adminhtml_dashboard_index: Please correct the XML data and try again.  [] []
[2017-07-01 04:11:57] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_3cf9ab1b1723bedc1dcd665a812b00335 and handles admin-1column: Please correct the XML data and try again.  [] []
[2017-07-01 04:11:57] main.CRITICAL: Broken reference: the 'header' tries to reorder itself towards 'global.notices', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
[2017-07-01 04:11:57] main.CRITICAL: Broken reference: the 'page.breadcrumbs' tries to reorder itself towards 'notifications', but their parents are different: 'page.wrapper' and 'notices.wrapper' respectively. [] []
[2017-07-01 04:11:57] main.CRITICAL: Broken reference: the 'global.search' tries to reorder itself towards 'notification.messages', but their parents are different: 'header.inner.right' and 'header' respectively. [] []
[2017-07-01 04:11:59] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE1_36f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again.  [] []
...

My menu.xml file is :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Company_Custom::manager" title="Grid Manager" module="Company_Custom" sortOrder="10" resource="Company_Custom::manager"/>
        <add id="Company_Custom::add_row" title="Grid Manager" module="Company_Custom" sortOrder="20" parent="Company_Custom::manager" action="company_custom/custom/index" resource="Magento_Backend::content"/>
    </menu>
</config>

And routes.xml is :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="company_custom" frontName="company_custom">
            <module name="Company_Custom" before="Magento_Backend" />
        </route>
    </router>
</config>

Why is it redirecting to dashboard?


texts:
How to Delete product from customer's wishlist in Magento 2
using dependency injection ?


texts: GZIP compression enabled in Apache but not working with Magento

texts:
I have enabled gzip compression in the Magento .htaccess file but online gzip test sites show that gzip is not enabled.

<IfModule mod_deflate.c>
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# Insert filter on all content
SetOutputFilter DEFLATE
# Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript font/woff

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>


texts: How to get price of specific sku from an order

texts:
I'm trying to get the price of a specific sku if it exists on an order, here's what my current code is:

$itemCollection = $order->getItemsCollection();
    foreach($itemCollection as $item) {
        $sku = $item->sku;
        if($sku == 'MySku') {
            $price = $item->getPrice;
        }
    }

I believe $price = $item->getPrice; is incorrect, I'm just not sure how to grab the line-item price for MySku from the order.

Any help would be great, thanks!


texts:
I have a cms page  in backend, with one widget inside.

Can i get the widget from html content of this page ? Because I would like to get the conditions of this widget.

Like exemple :

$toReturn = $myserviceFilter->getWidget($html or $myPage)

echo $toReturn = {{widget type="cms/widget_page_link" ... }}

And after i can get the conditions with $filter->filter($toReturn)


texts: Magento 1.8 admin user name and password right but not redirect to dashboard

texts:
After migrate live server to locahost admin user name and password right but not redirect to dashboard.

When i enter http//127.0.01/magento/admin it automatically move to http://127.0.0.1/dashboard/, but http//127.0.01/magento/index.php/admin working.
In this link http//127.0.01/magento/index.php/admin admin panel username and password right but not redirect to dashboard.

I clear all cache files in var/cache folder and session files var/session folder.

In core_config_data also changed like

web/unsecure/base_url as
http://127.0.0.1/magento/
web/secure/base_url as
http://127.0.0.1/magento/

And also changed database name, username, password in local.xml


texts:
I try to override the \Magento\Catalog\Block\Product\View\Gallery in my module.

I added the below line to my di.xml file for override above block

<preference for="Magento\Catalog\Block\Product\View\Gallery" type="Vendor\Module\Block\Product\View\GalleryXY" />

and I create the GalleryXY.php file and override methods but it does not work.

<?php
namespace Vendor\Module\Block\Product\View;

class GalleryXY extends \Magento\Catalog\Block\Product\View\Gallery{

public function doDebugg() {

    return 'blub';
    }
  }
?>

can anyone help me on this?


texts: Shipping Label Creation - ShipWorks Alternative in Magento Admin Panel

texts:
New to Magento and slightly confused on the shipping process. It seems most people use a shipping solution of either a Desktop client or cloud based solution. Similar to ShipWorks or ShipStation.

I am looking for a Magento extension to be an alternative to these products that would seamlessly integrate with the Magento admin panel. I Seem to be having trouble locating one.

What is the best way to manage shipping and label creation with UPS and USPS?  Are Solutions like ShipWorks and ShipStation the best methods?


texts: How to reindex data with shell_exec cron magento

texts:
$indexer="/var/www/clients/client1/web38/web/shell/indexer.php";
if(file_exists($indexer))
{
            $idxlist=array("catalog_product_attribute",
                           "catalog_product_price",
                           "catalog_product_flat",
                           "catalog_category_flat",
                           "catalog_category_product",
                           "catalog_url",
                           "catalogsearch_fulltext",
                           "cataloginventory_stock");
    //reindex using magento command line
    foreach($idxlist as $idx)
    {
        echo "reindex $idx \n ";
        shell_exec("php /var/www/clients/client1/web38/web/shell/indexer.php --reindex $idx");

OR
    exec("php /var/www/clients/client1/web38/web/shell/indexer.php --reindex $idx");

Re-indexing is not working with this way , what issue in my code , please tell me suggestion.


texts:
i know all process and commands to be run after uploading language package in cPanel. but the point i'm confusing on is that, where do i have to upload that .zip file in the cPanel?
in which directory should i upload the language package?


texts: Magento sales_order_place_after event not working

texts:
I have created a custom module to catch the sales_order_place_after event, but when i finish a order nothing happen.
My module it's active.

My module looks like this:

config.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <In2itive_OrderComment>
      <version>0.1.0</version>
    </In2itive_OrderComment>
  </modules>
  <global>
    <models>
      <ordercomment>
        <class>In2itive_OrderComment_Model</class>
        <resourceModel>in2itiveordercomment_mysql4</resourceModel>
      </ordercomment>
    </models>
    <events>
      <sales_order_place_after>
        <observers>
          <checkout_submit_all_after_handler>
            <type>model</type>
            <class>in2itive_ordercomment/observer</class>
            <method>logShipping</method>
          </checkout_submit_all_after_handler>
        </observers>
      </sales_order_place_after>
    </events>
  </global>
</config>

and Observer.php located in In2itive/OrderComment/Model/Observer.php :

<?php
class In2itive_OrderComment_Model_Observer
{

    public function logShipping($observer)
    {   Mage::log('your debug', null, 'yourlog.log');
        $order = $observer->getEvent()->getOrder();
        $history = $order->addStatusHistoryComment($order->getShippingMethod(), false);
        $history->setIsCustomerNotified(false);
        $order->save();
    }

}

Even a put a print_R i don't receive nothing.
My module it's not catching the event or I don't use the corect log method for this situation?


texts: What parent::preDispatch() in preDispatch actually does in Account Controller of magento

texts:
Many times I see parent::preDispatch() or for example parent::validate() withing actions / functions of magento.

I don't really understand the concern of that parent calls. Can you explain that please on Account Controller of magento.

Today I was working with Account Controller and need to add new action.

I was overriding preDispatch method, but that override doesn't work until I commented parent::preDispatch.

I decided with the solution to replace parent::preDispatch code with Mage_Core_Controller_Front_Action::preDispatch() but not sure if that right or not.

p.s. One day I was overriding validate method of the payment method, that doesn't work also until I commented parent::validate.


texts: What is the core_url_rewrite from M1 called in M2?

texts: I wanted to do a bulk import of url rewrites but cannot find the proper table.


texts: M2.2.2 Remove default schema.org rich snippets

texts: I have installed an extension which puts Rich Cards on my product pages, however the default Magento structured data code for rich snippets is still present. How can I remove this from product pages?


texts: Product image twice on homepage : Magento 2

texts: I have two image from different path but same image on homepage.Thats causing me low speed on gitmatrix.How to fix it.


texts: How to set a custom free shipping amount for each quote?

texts:
I need to set a custom free-shipping threshold(in config this is carriers/freeshipping/free_shipping_subtotal and can be set in the back-end) for each quote subtotal.

So to quotes above this subtotal amount free shipping will be applied.

The subtotal-amount will change dynamically(by user) and should revert to default value set in back end when user is logged off.

How do I go about doing this?


texts:
Haven't really seen anyone post about this. I need to call in a style sheet just for IE9 or lower, in my magento 1.9.2 - I'm doing it through xml like so:

<action method="addItem"><type>skin_css</type><name>css/cms.css</name><params/><if>lte IE 9</if></action>

But it doesn't seem to show in IE9 or anything lower. I thought my syntax is correct but im not sure.

Any help would be awesome.


texts: Products grid in admin - add custom attribute(select drop-down) column

texts:
I need to fetch select drop-down labels of my custom product attribute into custom column in admin product grid.

What I have managed to do now is to fetch select values. So for example I have:

<select value="12">23g</select>
<select value="13">44g</select>
<select value="14">54g</select>

and in the column I get the numbers 12, 13, 14 instead of 23g, 44g and 54g.

I've created my custom column by overriding Mage_Adminhtml_Block_Catalog_Product_Grid block. The attribute is 'custom_weight'. I've added this line in _prepareCollection method:

 $collection->addAttributeToSelect('custom_weight');

and these lines in _prepareColumns method:

$this->addColumn('custom_weight',
    array(
      'header'=> Mage::helper('catalog')->__('Weight'),
      'width' => '60px',
      'index' => 'custom_weight',
      'type'  => 'text'
    ));

So how do I get the labels instead of values? Thanks.


texts:
I hope someone can help because I'm really struggling. My Magento cron is throwing an error:
#0 /app/code/core/Mage/Cron/Model/Schedule.php(68): Mage::exception('Mage_Cron', 'Invalid cron ex...')
#1 app/code/community/Aoe/Scheduler/Model/Schedule.php(858): Mage_Cron_Model_Schedule->setCronExpr('0 0 3 1/1 * ? *')
#2 app/code/community/Aoe/Scheduler/Model/Schedule.php(128): Aoe_Scheduler_Model_Schedule->setCronExpr('0 0 3 1/1 * ? *')
#3 app/code/community/Aoe/Scheduler/Model/ScheduleManager.php(254): Aoe_Scheduler_Model_Schedule->initializeFromJob(Object(Aoe_Scheduler_Model_Job))
#4 app/code/community/Aoe/Scheduler/Model/ScheduleManager.php(165): Aoe_Scheduler_Model_ScheduleManager->generateSchedulesForJob(Object(Aoe_Scheduler_Model_Job))
#5 app/code/community/Aoe/Scheduler/Model/Observer.php(43): Aoe_Scheduler_Model_ScheduleManager->generateSchedules()
#6 app/code/local/Mage/Core/Model/App.php(1300): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#7 app/code/local/Mage/Core/Model/App.php(1281): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
cron.php(77): Mage::dispatchEvent('default')
#10 {main}

The problem I have is I just can't find the job that's got that cron expression! I've tried grep in my Magento directory for the expression but all I get is the error reports/logs.
Can anyone help?


texts: Magento2 update minicart using custom ajax

texts:
I have scenario to update quantity using +/- button in in magento2 minicart.
I override MagentoCheckout to my theme and edited minicart/items/default.html and made the changes , now i need to make auto update of price and quantity change on click of +/- button.

My ajax call on click

function plus(idvl)
        {
        fieldName = idvl;
        fieldName = fieldName.slice(1);
        var currentVal = parseInt($('#cart-item-'+fieldName+'-qty').val());
        var currentVal = parseInt($('#cart-item-'+fieldName+'-qty').val());
        if (!isNaN(currentVal)) {
            $('input[name='+fieldName+']').val(currentVal + 1);

        vr=new Object();
        vr["item_id"]  = fieldName;
        vr["item_qty"] = currentVal;
        vr["form_key"] = '<?php echo $FormKey->getFormKey();?>';
            $.ajax({
                url: '<?php echo $this->getBaseUrl(); ?>checkout/sidebar/updateItemQty/',
                dataType: 'json',
                type : 'post',
                data: vr,
                success: function(data){
                    console.log(JSON.stringify(data));
                }
            });

        } else {
            $('input[name='+fieldName+']').val(0);
        }
        }

Now the ajax call works and it return status 200K {success:true} but the contents are not updated. is there any way to achieve it ?

After updateItemQty ajax call there is a another call which works if i directly clicking on the update button in the minicart like

customer/section/load/?sections=cart%2Cmessages&update_section_id=true&_=12

But i'm not sure how this one is triggered in the core code. Any help is appreciated thanks in advance.


texts: Removing attribute set along with extension removal

texts:
I have a custom Magento extension which is adding a new attribute to catalog product, but with one big problem. If you want to delete it (the extension), on the product page and the admin product page there will be a fatal error, because in the database a reference to the frontend model and backend model still exist.

I need to find the event which is responsible for removing a Magento package extension, and then also delete the attribute set in it.


texts: How to remove Company and Fax field from onepage checkout

texts:
I'm would like to remove company & fax field from the checkout page, i already comment out the company and fax field, but it doesn't work.

I removed it from:

/app/design/frontend/base/default/template/checkout/onepage/billing.phtml
/app/design/frontend/base/default/template/checkout/onepage/shipping.phtml

And also from RWD template.


texts:
As per the v2.2.2 CHANGELOG, M2 has removed the Recurring Profile feature in 0.1.0-alpha108 version as mentioned under Various improvements section.

However, if you look at the changes in 2.0.0.0-dev65 version, it says that Recurring Profile has moved to a separate module as mentioned under Modularity improvements section, but there is no such module.

So does M2 have the Recurring Profile feature or planning to have in the future releases?


texts:
In Magento 1.x I have used the Tridian New Arrivals code to list "New Arrivals" on my homepage.

Moving to Magento 2.1.5, I want to do the same thing, but am lost in how to achieve this?

Perhaps the easiest way to describe this is I want to display a list of products most recently created in Magento (so based on the product ID, in descending order - most recently created item being the top of the resultant list).

My products do not have the "new from" dates set in magento, so I need to use the product ID method for this task.

Can anyone point me in the right direction to achieve this?


texts: Product / Supplier association - the same product with different price per supplier

texts:
I'm trying to build a store that has different suppliers that provide the same products but with different prices. Target is analyzing prices and show products with min prices to the customers.
Can anyone point me in the direction?


texts:
I want to rearange those "steps" inside all emails and pdf-printouts.

Is there any clear way to do that ?

Also, if possible, i want to change the "Steuer" to display another text. Is that also possible in a fast and Clear way ?


texts: please help with this installation error

texts:
I have installed Magento 2.3.0 from site ground, when clicking the link to my website i get this:

  Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/motiveat/public_html/vendor/magento/framework/Filesystem/Directory/Write.php on line 35

what do i do?, what have i done wrong? i am not tech savvy and just want to build my website

thanks


texts: Magento 1.9 CMS Pages changing content format while saving

texts:
I am saving my HTML content in CMS pages of Magento 1.9.3.7. But It's changing the format of my HTML content and adding a slash when a doublequote found in the code.
For example when I save below code:

How To Find Us

It changes it after saving and change it to :

How To Find Us

Please help tme to resolve the issue.


texts: Why PHP Settings Check and Checking Component Dependency showing error during Magento 2.3 upgrade?

texts:
I was Upgrade Magento from 2.1.12 to 2.3 using Web Setup Wizard. During this process, It show two error PHP Settings Check and Checking Component Dependency.

We already set memory_limit=2GB in php/php.ini, But it show same error.
Please Guide me.


texts: Can't find css and js files for magento 2.0.7

texts:
I've just installed Mangento 2.0.7 on Xampp(Windows). But remarked that files referenced in pub/static/adminhtml/Magento/backend/en_US's subfolders does not exist.

For example, pub/static/adminhtml/Magento/backend/en_US/requirejs/require.js return 404, and does really not exist in the folder.

What's going wrong ? How to fix this ?


texts: Magento Enterprise. What happens if you can't afford it anymore?

texts:
I know this isn't a code-base question, is more like a legal advice. One of my clients paid for Magento Enterprise last year but can't afford it now. Do you know what happens if you don't renew the license? Can they interrupt your website or can you carry on with that enterprise installation and have no more updates or support like other extensions/software and then, downgrade to Community Edition?

If anyone have had any experience with this that can help, please, I'm a little bit lost and I can't find anything in the Magento website about the Enterprise Agreement.

thanks a lot,


texts: Images with size larger than 1 MB give error - Magento 2.3

texts: Is it normal for Magento in version 2.3.0 to fail me when trying to upload an image that is larger than 1 MB?


texts: What event to use for successful order creation

texts:
I need to run some custom code after a successful order creation. I'll need to access each item in an order, both the quote item and subsequent order item. My first instinct was to use the following events:

sales_convert_quote_item_to_order_item
sales_order_item_save_after

However, when using the Authorize.net gateway, both of these events are dispatched when a transaction fails and no order is created! Is there a later event to use that would still allow access to quote items? Or, is there a way to test for a successful transaction within these two events?

Thanks!


texts: Tables permission_block and permission_variable did not get created after SUPEE-6788

texts:
I installed the patch SUPEE-6788 on my local website and everything went fine. I uploaded all modified files to our production website but tables permission_block and permission_variable did not get created.

I have done the same steps on other 2 websites before this one and everything went fine (one has the same version).

What can I do?

I have already cleared the cache and visited the home page.


texts: Magento 2.1.10 ce Developer Documentation

texts:
Where can I find the Developer Documentation for an older version of Magento, specifically, version 2.1.10.
Magento's website only has the DeVDocs for 2.2 and while these are okay I would they aren't exactly what I am looking for...


texts:
i have landing page in magento , i have ajax contact form but, i want take action contact form default!
in url has contact_me.php but it doesn't work so could u help me what can i do?

 $.ajax({
                    url: "contact_me.php",
                    type: "POST",
                    data: {
                        name: name,
                        phone: phone,
                        email: email,
                        message: message
                    },
                    cache: false,
                    success: function() {
                        // Success message
                        $('#success').html("
");
                        $('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;")
                            .append("</button>");
                        $('#success > .alert-success')
                            .append("Your message has been sent. ");
                        $('#success > .alert-success')
                            .append('
');


texts: Images not showing on category page Magento 2.3.5

texts:
I have issue with no images appearing on category page and when trying to run the magento cli catalog:images:resize I would get an error wrong file.
I discovered the issue is in Magento 2.3.5 a new check was added in the file:
vendor/magento/framework/image/adapter/Gd2.php on line 62.
if (!$filename || filesize($filename) === 0 || !$this->validateURLScheme($filename))

The validateURLScheme is the new item.  At that function the following checks are made. (line 96).
    $allowed_schemes = ['ftp', 'ftps', 'http', 'https'];

I'm developing on Windows and in my setup the location within the filename is not a url but rather a disk (ie: D:/xampp/htdocs ....) so the scheme in the routine becomes "D" and fails the check.    If I place a return true at this function then my system works.
I checked Magento 2.3.4 and it did not have this extra check. So is there an alternative method that I missed with images that applies a url to the location.  This new check implies images should be referenced by url.


texts: Magento Checkout top link change link path

texts:
The top links for Magento include the following

My Account  My Wishlist Checkout and Login

When Checkout is clicked, it takes you to Checkout page.

I would like it when Checkout is clicked, it takes you to My Cart or the Shopping Cart page.

How can this be done?


texts: How to get gift card history details by Customer ID?

texts:
I have a requirement that I need to show the gift card history based on the customer. For example, if customer A redeem a gift card, we need to show the redeem date, gift card amount, etc., in account page.
How can I get the gift card details based on Customer?
Any help will be appreciated!


texts: How to get current category id in view page of Magento?

texts:
I have tried this code but while refreshing the page it gives me error.

$category_id = Mage::registry('current_category')->getId();


texts: Magento 2 Layered Navigation custom attribute with multiselect not showing In filter

texts:
I created a new product attribute named, 'decade', which is multiple select filter. each product has zero or more than 1 options to select. I changed it to be 'searchable' and 'use in navigation search (with result)'. But this filter just doesn't show up in the navigation filter section. I run a script to obtain all available filters for the category which contains all the product with the attribute assigned. And I got following, I wonder what causes the count always be 0. I did run reindex and still no luck.
{
"availablefilter": {
    "Price": [
        {
            "display": "$0.00 - $99.99",
            "value": "-100",
            "count": "645"
        },
        {
            "display": "$100.00 and above",
            "value": "100-",
            "count": "1"
        }
    ],
    "Decade": [
        {
            "display": "1910s",
            "value": "5459",
            "count": 0
        },
        {
            "display": "1920s",
            "value": "5460",
            "count": 0
        },
        {
            "display": "1930s",
            "value": "5461",
            "count": 0
        },
        {
            "display": "1940s",
            "value": "5462",
            "count": 0
        },
        {
            "display": "1950s",
            "value": "5463",
            "count": 0
        },
        {
            "display": "1960s",
            "value": "5464",
            "count": 0
        },
        {
            "display": "1970s",
            "value": "5465",
            "count": 0
        },
        {
            "display": "1980s",
            "value": "5466",
            "count": 0
        },
        {
            "display": "1990s",
            "value": "5467",
            "count": 0
        },
        {
            "display": "2000s",
            "value": "5468",
            "count": 0
        },
        {
            "display": "2010s",
            "value": "5469",
            "count": 0
        }
    ],
    "Rating": [
        {
            "display": "$0.00 - $99.99",
            "value": "-100",
            "count": "645"
        },
        {
            "display": "$100.00 and above",
            "value": "100-",
            "count": "1"
        }
    ]
}
}


texts: How to override core files into custom module app/code?

texts:
I am added a custom attribute in my  wishlist knockout core file,
Code : https://codeshare.io/5ZlEv7  Line Number: 142
I want to override into my custom module,
I am created a custom module, how to properly included my changes
app/code/Vendor/Wishlist/etc/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\Wishlist\CustomerData\Wishlist">
        <plugin disabled="false" name="Vendor_Wishlist_Plugin_Magento_Wishlist_CustomerData_Wishlist" sortOrder="10" type="Vendor\Wishlist\Plugin\Magento\Wishlist\CustomerData\Wishlist"/>
    </type>
</config>

app/code/Vendor/Wishlist/Plugin/Magento/Wishlist/CustomerData/Wishlist.php
  <?php
/**
 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Vendor\Wishlist\Plugin\Magento\Wishlist\CustomerData;

class Wishlist
{

    protected $wishlistHelper;

    public function __construct(
        \Magento\Wishlist\Helper\Data $wishlistHelper
    )
    {
        $this->wishlistHelper = $wishlistHelper;
    }

    public function afterGetSectionData(
        \Magento\Wishlist\CustomerData\Wishlist $subject,
        $result
    ) {

        // Your code here

        return $result;
    }
}

My question, how to include my changes into app/code/Vendor/Wishlist/Plugin/Magento/Wishlist/CustomerData/Wishlist.php
Should i add the whole function, code : https://codeshare.io/29AL38
or
should i add a specific line of change?
'product_brand' => $product->getResource()->getAttribute('brand')->getFrontend()->getValue($product),

New to module customization, anyone help thanks.


texts: Magento2 : Zend_Json_Exception : Decoding failed: Syntax error in Magento 2

texts:
I have a custom module which is working perfectly in my local machine but while I am trying to enable my module in my magento 2store hosted in cPanel,

I am getting below error

> bbcmanagement@billionaireboysclub.com [~/public_html]# **php bin/magento module:enable -v  BBC_ProductAdminAccess**

>ea-php-cli Copyright 2017 cPanel, Inc.

>  [Zend_Json_Exception]   Decoding failed: Syntax error
> Exception trace:  () at /home/bbcmanagement/public_html/vendor/magento/zendframework1/library/Zend/Json.php:97 Zend_Json::decode() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/PackageInfo.php:85 Magento\Framework\Module\PackageInfo->load() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/PackageInfo.php:208 Magento\Framework\Module\PackageInfo->getRequire() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/DependencyChecker.php:132 Magento\Framework\Module\DependencyChecker->createGraph() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/DependencyChecker.php:95 Magento\Framework\Module\DependencyChecker->checkDependencyGraph() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/DependencyChecker.php:82 Magento\Framework\Module\DependencyChecker->checkDependenciesWhenEnableModules() at /home/bbcmanagement/public_html/vendor/magento/framework/Module/Status.php:97 Magento\Framework\Module\Status->checkConstraints() at /home/bbcmanagement/public_html/setup/src/Magento/Setup/Console/Command/AbstractModuleManageCommand.php:92 Magento\Setup\Console\Command\AbstractModuleManageCommand->execute() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257 Symfony\Component\Console\Command\Command->run() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:874 Symfony\Component\Console\Application->doRunCommand() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:195 Symfony\Component\Console\Application->doRun() at /home/bbcmanagement/public_html/vendor/magento/framework/Console/Cli.php:96 Magento\Framework\Console\Cli->doRun() at /home/bbcmanagement/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:126 Symfony\Component\Console\Application->run() at /home/bbcmanagement/public_html/bin/magento:23

>module:enable [-f|--force] [--all] [-c|--clear-static-content] [--magento-init-params="..."] [module1] ... [moduleN] }

  app\code\BBC\ProductAdminAccess\composer.json

{"name": "bbc/sample-module-minimal",
  "description": "A module that creates a page in the Magento admin area",
  "type": "magento2-module",
  "version": "1.0.0",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "require": {
    "php": "~5.6.0|7.0.2|7.0.4|~7.0.6"
  },
  "autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "BBC\\ProductAdminAccess\\": ""
    }
  }}

  app\code\BBC\ProductAdminAccess\registration.php

    <?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'BBC_ProductAdminAccess',
    __DIR__);

I have checked the format of the json file using online format checker and it came out fine.

Please help Me with it.


texts: Magento Catalog Setup Script Can't Complete

texts:
I'm having trouble getting some of my modules to complete their setup scripts. Looking at the core_resource table shows that catalog_setup has a higher version than data version. This has been a problem since I took over this position and I think this error may be preventing other module upgrades from running. Every time the cache is flushed I receive several errors like:

Error in file:/www/sites/www.oursite.com/files/html/app/code/core/Enterprise/Catalog/sql/enterprise_catalog_setup/upgrade-1.13.0.9-1.13.0.10.php" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '5-catalog_product_website-product_id' for key 'UNQ_ENT_MVIEW_SUBSCRIBER_METADATA_ID_TARGET_TABLE_TARGET_COLUMN', query was: INSERT INTO `enterprise_mview_subscriber` (`metadata_id`, `target_table`, `target_column`) VALUES (?, ?, ?)

Trace:
#0 /www/sites/www.oursite.com/files/html/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /www/sites/www.oursite.com/files/html/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.13.0.9', '1.13.0.11')
#2 /www/sites/www.oursite.com/files/html/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.13.0.9', '1.13.0.11')
#3 /www/sites/www.oursite.com/files/html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /www/sites/www.oursite.com/files/html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /www/sites/www.oursite.com/files/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /www/sites/www.oursite.com/files/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /www/sites/www.oursite.com/files/html/index.php(85): Mage::run('', 'store')
#8 {main}

Can anyone please point me in the right direction for a fix for this? I can not reproduce this issue on my development site which is running the same version controlled code with a duplicate database.

Update:
After re-checking all my assumptions, I was able to get this issue to appear on the development site. It turns out that the cron job responsible for creating the development database dump had been blocked. After getting a fresh copy of the database, the error was present.


texts:
When creating a new product in the Magento2 admin I get an error upon saving.

It says:

The file "/path/to/folder/pub/media/tmp/catalog/product/p/productimage.jpg" doesn't exist or not a file.

I can't create new products. Please help.


texts: Magento CE 1.9.1 I need to set some products to ship ground

texts: Some of my products have to be shipped via Ground the others can be shipped express, is there a way to set this up in Magento?


texts: https via htaaccess multiple website rule

texts:
I'm using 2 websites on 2 domains. I'm loading correct website via htaaccess with rules as below:

RewriteCond %{HTTP_HOST} .*clothes\.eu [NC]
RewriteRule .* - [E=MAGE_RUN_CODE:clotheseu]
RewriteCond %{HTTP_HOST} .*clothes\.eu [NC]
RewriteRule .* - [E=MAGE_RUN_TYPE:website]

Now I added SSL and frontend/admin area works from https url.

The problem is that when user is using OLD http address for category/products/cms, they are redirected 302 to homepage instead of correct page.

Example:

http://clothes.eu/product.html is redirected to: https://clothes.eu instead of https://clothes.eu/product.html

htaacces as above points to main domain: clothes.eu and all my product/category suffix is cut.

I found Admin option: Auto-redirect to Base URL > 302 > this is probably doing this. but why this cuts all product/category suffix in url ? should I disable it ?

Could somebode help me with the htaaccess rule to avoid category/product cut in URLs that come from http ?
Thanks a lot


texts: The admin layout is showing in xml format

texts: I am using magento 2.3 when i run the deploy command my admin layout is show in xml  format is any one help me to solve this problem..


texts:
I have created a config in the backend under System > Config. The configuration allows the user to essentially turn the store on or off (it displays a message that the store is closed, and disables the add to cart button). What I would like to do is set up a cron job so that instead of having to log in every morning and enable the store through this config, and then at the end of the day, disable the config.

Is it possible to do this through the magento cron jobs menu or will I have to somehow write all this myself?

Thanks!


texts: Extension works fine on local system but on live instance it gives me error

texts:
Can someone please give me some detail about my issue.
I am duplicating categories along with the product on my local system it works fine although it takes little more time but works fine on my live instance it gives me 404 error after completing all functionality don't know why behaving strangely.

My local Magento version is 2.2.7

live instance Magento version 2.2.7 on which it gives 404 error and remain stuck on the controller rather than returning value

and

live instance Magento version 2.3 on which it gives me undefined index in which I am getting value through post method and it is getting the value I double checked it

Although it completes its functionality in both live instances and then through such error at the end.


texts: Is there a way to show products in only one category and nowhere else in the website?

texts:
I want to create a restricted category for over thirteen people. Is there a way to not have these products appear in anywhere else in the catalog, i.e. search, best sellers, etc?

Thanks


texts:
While reading up on some Magento I was again attracked to the following: How can I set-up a Magento CDN on local server by subdomain? [also see attached images]

I am envisioning to set-up cdn.mymagentoserver.com, have it point to the same public_html folder as www.mymagentoserver.com and change the media directories as shown below.

Question:

how does one set-up a subdomain like described?

Additional to think about

would it also work for all domains of a multistore?
how about when I add https in the future? Wouldn't the images be coming from an unsafe domain if I had a SAN certificate? or would I just add the subdomain too
Is this all worth it?


texts: How to add custom class in Product Attribute?

texts:
I am trying to add a custom class for some validations and styling purposes in a Programatically created Product Attributes, I have tried frontend_class and class property but it didn't work.
Can anyone help me with that ?


texts: Trying to use an action button to call function - Magento 1.9

texts:
I'm trying to add an action button in M1 dashboard.

I want the button to call the function I've created, and display a warning message.

The first snippet is what I started with and I'm struggling to get it working (second snippet).

I started off with this example:

<a class="icon_list preview_grid" title="<?php echo $this->__('Delete') ?>" onclick="return confirm('<?php echo $this->__('Are you sure want to delete').'?'; ?>')"
href="<?php echo Mage::getBaseUrl() . "booking/booking/delete/"; ?>id/<?php echo $_product->getId(); ?>"  ><?php echo $this->__('Delete') ?>
/strong>

and then modified a bit to get the below, but can't get it working.

perhaps someone can help. Many thanks

<a class="icon_list calender" target="_blank" title="Copy"  onclick="return confirm('<?php echo $this->__('Are you sure want to copy').'?'; ?>')"
href=$this->__<?php echo Mage::helper(‘function’)->Duplicate_frontend(); ?> ><?php echo $this->__('Copy') ?>

Here is my function code:

Duplicate_frontend.xml:

<?xml version=“1.0”?>
<config>
<modules>
<Duplicate_frontend_Function>
<active>true</active>
<codePool>local</codePool>
</Duplicate_frontend_Function>
</modules>
</config>

config.xml:

<?xml version=“1.0”?>
<config>
<modules>
<Duplicate_frontend_Function>
<version>1.0.0</version>
</Duplicate_frontend_Function>
</modules>
<global>
<helpers>
<function>
<class>Duplicate_Function_Helper</class>
</function>
</helpers>
</global>
</config>

Data.php:

class Duplicate_Function_Helper_Data extends Mage_Core_Helper_Abstract
public function Duplicate_frontend() //change the function name
{
$productId = $observer->getEvent()->getProduct()->getId();
$productObject = Mage::getModel('catalog/product');
$_product = $productObject->load($productId);
$newProduct = $_product->duplicate();
//new product status is disabled - to view in the frontend you will need to set the status as enabled
$newProduct->setStatus(1);
$newProduct->setName('Duplicate-' . $_product->getName());
$newProduct->setSku('value-' . $productId);
$newProduct->setWebsiteIds($_product->getWebsiteIds());
//set the product stock and qty to display product in the frontend
//while creating duplicate product, it will update the new product to have qty 0 and out of stock
$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($newProduct->getId());
if ($stockItem->getId() > 0 && $stockItem->getManageStock())
{
$qty = 100;
$stockItem->setQty($qty);
$stockItem->setIsInStock((int)($qty > 0));
$stockItem->save();
}
$newProduct->getResource()->save($newProduct);
//automate reindexing - to display the product in the frontend
$indexers = Mage::getSingleton('index/indexer')->getProcessesCollection();
foreach ($indexers as $indexer)
{
$indexer->reindexEverything();
}
}

Revised action button code.
The function is performed upon page load (not good),
Need to action the function upon click/confirm.
How should I change this code?

<a class="icon_list calender" target="_blank" title="Copy"  onClick="return confirm('<?php echo $this->__('Are you sure want to copy').'?'; ?>')" href="<?php echo Mage::helper('DuplicateModule')->duplicatefunction(); ?>" ><?php echo $this->__('Copy') ?>


texts:
In my shipping.html  I see this line of code

<render args="shippingMethodListTemplate"/>

Is this just saying "put the content of this template here" or is there something else going on?

EDIT:
if this is just calling this content how do I find it?


texts: Error reindexing fulltext search after elasticsearch had been enabled on Nexcess cloud hosting (Magento 2)

texts:
I get this error when trying to run the indexer for the search:
php bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search indexer process unknown error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types
cannot be provided in put mapping requests, unless the include_type_name
parameter is set to
true."}],"type":"illegal_argument_exception","reason":"Types cannot be
provided in put mapping requests, unless the include_type_name parameter
is set to true."},"status":400}

Any advice? I can't proceed to update Magento 2 as Elasticsearch is required now.
This is a new installation that has not seen much modification apart from installing litextension for data migration.
Any help is appreciated


texts: Magento 2 error when run php bin/magento setup:di:compile

texts:
I am using magento 2.1.5 when i change developer to production mode got the error like this

Enabled maintenance mode

Starting compilation

Something went wrong while compiling generated code. See the error log for details.

Command returned non-zero exit code:

/opt/remi/php70/root/usr/bin/php -f /www/sites/hostname/files/html/bin/magento setup:di:compile

so i running the following command

php bin/magento setup:di:compile

got the error like below

[ReflectionException]
  Class Magento\Braintree\Model\Config\PayPal does not exist


texts: Help Identifying this Magento Theme (Reward)

texts:
A client of mine is adamant that I use the theme located at (http://www.7diamonds.com). I've tried inspecting the element but they have left not traces of the theme used. They also do not cache.

So I'm pretty lost as to how I should go about finding this theme. If one of you heroes out there can identify this theme I'd be more than willing to reward you via PayPal.

Edit: Lemme add some more info. They've renamed the theme package so I'm not sure if you can simply identify the theme by just inspecting the page. I'll reward you generously if someone is able to figure this out. Thanks!

Thanks!


texts: Magento 1.9 : Add custom options programmatically to associated products

texts:
I have been working on showing custom options of simple product for grouped product. I am done with initial phase of allowing required custom option product and then showing it on frontend.
I have modified checkout/cart/add to add products with custom option to cart. This is also working fine. But I see products are being added twice to cart. Once with custom option and another one without custom option.
I have debugged app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php . Here, protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode) is responsible for adding product to cart. I tried adding custom option values of products from here. But couldn't succeed.

Note:- Here I am not trying to create new custom options. I just want to set the values of custom option.

Any help will be appreciated. Thanks in advance.


texts: Change hover color of Luma Font icons - Magento2

texts:
I did now search for hours and couldnt find a way how to change the color AND hover color of icons using the "luma font icons" font.

Any idea?

Thanks a thousand.


texts: Changing limit on number of downloads for past and future purchases - Downloadable Products

texts:
I have a client with Downloadable Products on their Magento site.

Their Downloadable products are currently set at 5 downloads each. They want to increase this to 10 across the board for all past purchases, and all future purchases.

There are also some products/purchases with Unlimited downloads, which I don't want to touch.

I believe I have to run two SQL queries on the database to achieve this.

UPDATE downloadable_link SET number_of_downloads='10' WHERE number_of_downloads='5'

...to change the download limit on existing products (for future purchases)

UPDATE downloadable_link_purchased_item SET number_of_downloads_bought='10' WHERE number_of_downloads_bought='5'

...to change the download limit for past purchases.

Could someone reassure me this is all that needs to be done, or is there a better way?

The client has multiple websites so this applies to CE 1.8.1.0 and EE 1.14.0.1


texts: magento set shipping method for each product on checkout page

texts:
I have 2 method shipping, I would like to check out, each product can be individually selected method shipping.

Can this be achieved?


texts: Magento2 installation stuck on user configuration (49%) on Ubuntu vagrant

texts:
I try to install Magento2 on my Ubuntu using vagrant,

the installation stuck on

  " Installing user configuration... "

without any error.


texts: M2 - Display "in stock / out of stock" ONLY when item is out of stock?

texts:
I've just turned on the option "Display Products Availability in Stock on Storefront" which is working as it should - display either "in stock" or "out of stock" on the front end, but I want to change the default behavior so that the message only shows when a product is out of stock...

So "In stock" = no message and "Out of Stock" = Shows out of stock message

Can this be done?

Thanks


texts:
I have done alot of tutorials to enable layered navigation like this one - Link

However all i get on the left column bar is this the compare products list. All i want to add is the price ranges and sub category like this

Is there something i am missing ??? I am using M2 community 2.2.2

Any help is appreciated , however i am not a computer programmer and dont know anything about coding.


texts: Magento2.2 what do people use for shipment tracking

texts:
I am wondering what others use on there magento 2.x site to allow customers to enter in an order number and view the USPS shipment tracking info. such as if an order is out for delivery and or when/where it was last scanned in by usps.

On our Magento 1.9 site we use to have a plugin that enabled customers to do this and it would then grab the usps tracking number automatically from an order and show all the transit information. however i can not find any magento2.x compatible plugins. So wondering what others do ?


texts:
I have two views for my website.
A view for Europe and another for the Swiss.

Currencies are different but the problem is i would like to choose prices for each view.
Currently, prices for my second view are converted automatically.

So, i would like to know how to turn off this conversion.


texts: Magento2: "Use Default Value" for description. How to uncheck

texts:
"Use Default Value" in standard is selected for all  stores view.

In products --> Catalog I can switch store view example from default store view to English and then edit product and then in description uncheck "Use Default Value".

In single product I can switch store view:

and then uncheck:

But for above 11k products take more time. Any one know how to uncheck for all products description in one time?

@UPDATE

I will checked in database catalog_product_entity and then try edit sample product.

After this I see only value:

@update2:


texts:
I have products where multiple grouped products have the same simple product.

Simple Product SKU: prod1_1

Grouped Product1 SKU: group1_1 - associated product: prod1_1
Grouped Product2 SKU: group2_2 - associated product: prod1_1

I want to set up a coupon rule that will only apply to group1_1/prod1_1, but not group2_2/prod1_1. From what I've seen, the coupon code only seems to apply to the simple product. Is there a setting I'm missing, or would that be something custom?


texts: Magento 2.4.2 Installation Giving 404 issue

texts:
I am trying to install Magento2.4.2 . My system requirements seems fine. Installed PHP7.4 , Mysql 10, Elastic search 7.
And also I have ran this command first:

sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2/
bin/magento setup:install
--base-url=http://localhost/magento2
--db-host=localhost
--db-name=m242
--db-user=sammy
--db-password=Admin@123
--admin-firstname=admin
--admin-lastname=admin
--admin-email=admin@admin.com
--admin-user=admin
--admin-password=reset@123
--language=en_US
--currency=USD
--timezone=America/Chicago
--use-rewrites=1
Reindex
4.deploy
5.compile
6.upgrade
7.cache clean
permisson

And while running the site am getting the 404 error issue.
http://localhost/magento2
can some one please help me to get rid of this issue..
Thanks,


texts: make default language without language code at url

texts:
I have two languages on my magento. I would like to make one of them the default language without the /el/ language code.

So, the domain.com will load the default language (Greek) and the domain.com/fr/ will load the french version of my magento shop.


texts:
I have attributes wich display in customer_form_address_user_attributes BLOCK.
How i can pass or change attributes. Maybe some xml or di?


texts:
i've some issues with auto generating static files in pub/static folder

after use magento setup:static-content:deploy if i delete some static file generated by deploy like css and i point to the url like:

<my_domain>/pub/static/frontend/<my_module>/<my_theme>/en_US/css/theme.css

magento2 not auto generated it anymore... i need some tips!

i'm in developer mode
i've clear var/cache and var/view_preprocessed folders
i've flushed magento2 cache
i've set Server side less compilation
if i use magento setup:static-content:deploy all works perfectly!


texts:
I am trying to add a new site to Magento 1.5.1.0.

I have added the domain http://www.marisadirect.co.uk/ and set it to point to the correct location. I have also setup the new site in Magento admin and added it to the htaccess file.

SetEnvIf Host .*marisadirect.co.uk MAGE_RUN_CODE=marisam_en
SetEnvIf Host .*marisadirect.co.uk MAGE_RUN_TYPE=store

However when I try to access the site through my browser I get a 302 Temporary redirect to the site admin page.

Have I missed something?

Many thanks in advance.


texts:
I am trying to install Magento EE 2.0.2 on my local environment.
I download the version from my magentocommerce account.
When I run the composer install command it is all good except when it start to download magento/module-worldpay composant and I have the common error

  Installing magento/module-worldpay (100.0.3)
      Downloading: Connecting...
                                                                                [Composer\Downloader\TransportException]
  Invalid credentials for
  'https://repo.magento.com/archives/magento/module-worldpay/magento-module-worldpay-100.0.3.0.zip',
  aborting.

Note that config work fine with an other Magento 2 CE version on the same environment.

Before downvote my question there is the step I follow :
 - classic issue with /Users/{user}/.composer/auth.json file. I put my credentials in :

{
    "http-basic": {
        "repo.magento.com": {
            "username": "<public key from magento commencer account linked to EE>",
            "password": "<private key from magento commencer account linked to EE>"
        }
    },
    "github-oauth": {
        "github.com": "<Github token>"
    }
}

- I regenerate credentials from magentocommerce account
 - I run composer clear-cache

Do I miss something here ?
Is there any further action related to the EE version with the credentials ?

Thank you.

EDIT
As noticed Maddy in answer, the downloaded ZIP include the vendor/ directory with all the Magento Core / dependencies but in my case I work with GIT so I would like to be able to run composer install that I do not have to put the vendor/ directory in my repository.


texts: Magento 2.2.5 Question about permissions - checkout infinite loop

texts:
Currently I am in developer mode and I think I am having a problem with permissions. I am only using a magento user to run magento tasks and never sudo/root.

I have seen that the files that get deployed via setup:static-content:deploy are set to www-data:www-data instead of magento:www-data

Is this normal? The reason this got my attention was that by using a module (one-step-checkout) I was having an infinite loading loop in the checkout. And by inspecting the elements of the page I could see that I couldn't load a js file.

So, I thought that it was a file/folder permission problem.