texts: how to login customer programmatically in checkout magento?

texts:
I will explain step by step.

1.I selected checkout method as register.

2.So in billing information i get extra two fields password and confirm password.
and I have added extra customer type field.based on selection of customer type the tax should calculate in order review tab.

so normally the entire check out steps will temporarely store in quote object.But I want to store customer register information(in billing tab) permanently .because it should reflect in order review tab in order to tax sholud calculate based on customer type.
for that i created one observer

3.If i click continue button one event will trigger .it will save customer information in db permanently.

4.using above customer register information to login I placed following code below save functionality.

but its not working.I mean If i click continue button in billing tab it saving the data in db.but not login.

<?php
class Exinent_Billingtax_Model_Observer {
    public function autoRegisterBilling($evt){
        if(!Mage::helper('customer')->isLoggedIn()){
            $data = $evt->getEvent()->getControllerAction()->getRequest()->getPost('billing', array());
            //echo "<pre>";
            //print_r($data);
            $customer = Mage::getModel("customer/customer");
            $email = $data['email'];
            $group_id=$data['group_id'];
            $websiteId = Mage::app()->getWebsite()->getId();
            $store = Mage::app()->getStore();
            $pwd = $data['customer_password'];
            $customer->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($email);

            if (!$customer->getId()) {
                 //Code begins here for new customer registration
                $customer->website_id = $websiteId;
                $customer->setStore($store);
                $customer->firstname = $data['firstname'];
                $customer->lastname = $data['lastname'];
                $customer->setEmail($email);
                $customer->setGroupId($group_id);
                $customer->setPassword($pwd);
                $customer->sendNewAccountEmail('confirmed');
                $customer->save();
                   }

            Mage::getSingleton('customer/session')->loginById($customer->getId()); // to login that customer.
        /*if($customer->getId()>0){
            $userSession = Mage::getSingleton('customer/session');
            $userSession->setCustomer($customer);
            Mage::dispatchEvent('customer_login', array('customer'=>$customer));
            Mage::app()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage'))->sendResponse();
            exit;
            }*/
           }
    }

}


texts: Redirecting the user from codeigniter to magento using magento

texts:
I am using codeigniter and Magento in same domain. And I have created a function in codeigniter to check the magento customer log in status. If the customer is not logged in magento then return to magento login page but it is not redirecting it and I used just php header function but I want to use magento function and as well the reason.

public function loggedIn(){

    //$customerInfo = array();
    $dir = $_SERVER['DOCUMENT_ROOT'];
    $fullPath = $dir.'/magento/app/Mage.php';
    echo $fullPath;

    require_once( "$fullPath" );
    umask(0);

    // Initialize Magento
    Mage::app();

    // You have two options here,
    // “frontend” for frontend session or “adminhtml” for admin session
    Mage::getSingleton('core/session', array('name' => 'frontend'));
    $session = Mage::getSingleton('customer/session', array('name'=>'frontend'));
if($session->isLoggedIn()){
    echo "Logged In";
    return $session->getCustomer();
    }
    else{
    echo "Logged out";
    //header('Location:http://localhost/magento/customer/account');
    $url = "http://localhost/magento/customer/account";
     Mage::app()->getFrontController()->getResponse()->setRedirect($url);
    }

 }

thanks :)


texts: Magento 1.9 :- Add to Cart Helper - not working

texts:
I've been trying to fix a problem on an inherited Magento 1.9.1 site - the problem is coming from a custom category page I think.

The template is using the Add to Cart Helper - in what appears to be the same way as the working product list template.

On this page: http://www.trevorsorbie.com/shop/ranges.html, if you click the Add to Cart button on any product nothing is added to cart. If you log in to your account and click that button it does add to cart..

But this is working on this page: http://www.trevorsorbie.com/shop/products.html

On the ranges.html page I've used:

<a class="btn btn-sm add-to-cart-alt" href="<?php echo Mage::helper('checkout/cart')->getAddUrl($_product)?>" title="Add Product to Cart">

    Buy

Any information or pointing me at reading material to fix this will be much appreciated!


texts:
I've install Latest version of Magento 2.1.8 and i've try to login into admin and working perfectly but after a few days i'm not be able to login again, i've reset the password, clean cache and i've creating a new user  but the some result.

See this screenshot

So Any Suggestions please about that


texts:
I want to disable the submit button of the contact form onclick, so that the button can be only clicked once. The only problem with this, is that it does not validate the form anymore. It directly submit the form, reload the page and show a error when some field are not filled.

How can I change this, so that it will disable the button, than validate the form and when successful, it will submit the form?

Therefore I use the following code:

<button type="submit" onclick="this.disabled=true;this.form.submit();" title="<?php echo Mage::helper('contacts')->__('sent') ?>" class="button"><?php echo Mage::helper('contacts')->__('sent') ?></button>


texts: Tax miscalculation for partial creditmemo

texts:
We are working on a project for a customer that is running on Magento Community Edition 1.7.0.1.

We have encountered the following issue:

When we create a partial credit memo the recalculation of the tax amount is done properly. (=Total Tax field)

As soon as we click on the Total Tax field when viewing the details of the partial credit memo we just created the details pop out. (Default Magento behavior).

The calculation of the tax rate is wrong:

As you can see the "Total TVA" (=Total Tax) is correct but the detailed tax rate "TVA (21%)" is not correct.

The given amount next to "TVA (21%)" matches the total tax amount of the complete order we created.

Basically, it means that this isn't recalculated properly... Do any of you also have this issue? Could it be a Magento bug? Any idea what the cleanest way would be to solve this?


texts: Magento intermittently caching incorrect base URL

texts:
Every few hours my live Magento 1.7.0.2 installation is caching the wrong link URLs for the category navigation menu.

Sometimes they use the wrong form of the domain (without the www and adding an SID get var) in which case users get endlessly redirected to the homepage or, worse, they sometimes redirect to http://localhost! The same problem also occurs when accessing the backend.  Clearing the cache resolves the issue temporarily but it normally resurfaces after a 1-2 hours. Disabling the cache is a temporary fix but obviously not ideal for a production environment.

I’ve never seen this before, any suggestions?

Thanks in advance


texts: Generate url with multiple attributes for filter menu

texts:
I have these attributes in the sidebar:

When I click on a item then I get on the page with all products with the selected attribute. The url for this page is like site.html?modell=19
I have a main menu and would like to add items with multiple attributes for searches, like site.html?modell=19&modell=9. But the link shows only the result of the first attribute. So is there any way to combine multiple attributes in an url? Thanks


texts: How to display the value of drop down whether it is set to yes/no from dopbox in magento?

texts:
I created a custom attribute using installer as given below: . This attribute is created inside group Customer Product. I tried to accessed the value of dropdown but could not access it. How could I access the value from dropdown. Please suggest.

 <?php
    $installer = $this;
    /* @var $installer Mage_Core_Model_Resource_Setup */
    $installer->startSetup();
    $attrCode = 'customer_product';
    $attrGroupName = 'Customer Product';
    $attrLabel = 'Customer Product';
    $attrNote = 'Customer Note';
    $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup');
    $attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $attrCode);

    if ($attrIdTest === false) {
        $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCode, array(
            'group' => $attrGroupName,
            'sort_order' => 7,
            'type' => 'varchar',
            'backend' => '',
            'frontend' => '',
            'label' => $attrLabel,
            'note' => $attrNote,
            'input' => 'boolean',
            'class' => '',
            'source' => '',
            'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => true,
            'default' => '0',
            'visible_on_front' => false,
            'unique' => false,
            'is_configurable' => false,
            'used_for_promo_rules' => true
        ));
    }
    $installer->endSetup();
    ?>

Then I coded inside my theme in phtml to display the product only if customer product is set to yes. But its not working

<?php
 // $attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product','test');
 // echo $attribute_value = $attributeModel->getStoreLabel($storeId);
  $products = Mage::getModel("catalog/product")->getCollection()->addAttributeToSelect('*') ->setOrder('entity_id', 'DESC')->setPageSize(10);
  foreach($products as $product):
   // echo $product->getSku();
     $_product = Mage::getModel('catalog/product')->load($product->getId());
     $attribute_value = $_product->getAttributeText('customer_product');
     if($attribute_value == 'Yes')
      {
       ?>

        <img alt="" class="img-responsive" src="<?php echo Mage::helper('catalog/image')->init($_product, 'small_image')->resize(200,200); ?>">
       <?php
       ?>

       <?php
       echo $product->getName().'
';
       echo $product->getPrice();
       ?>

       <?php
      }
  endforeach;
?>

What's wrong with  my code?


texts: Get Option Value by Id of Attribute in Magento

texts: How can Magento find an attribute value by a given attribute label or a given attribute id?


texts: Running out of memory while reindexing using -d memory_limit=3G

texts:
I recently migrated data from Magento 1.8.1 to Magento 2.1.7, which includes around 700,000 customers.

After migration, I am running this command:

php -d memory_limit=3G bin/magento indexer:reindex customer_grid

But I am still getting a memory error:

PHP Fatal error:  Allowed memory size of 3221225472 bytes exhausted
(tried to allocate 20480 bytes) in /<doc-root>/vendor/magento/zendframework1/
library/Zend/Db/Statement/Pdo.php on line 291

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors
for more info on how to handle out of memory errors.

I have set memory_limit in php.ini to 3 GB. I can confirm that:

$ php -r "echo ini_get('memory_limit').PHP_EOL;"
3G

I am using SSD so cannot create SWAP as per the instruction in the link above.

What can I do to fix this problem?


texts: How to set default value for form fields?

texts:
I have an admin form field(textbox),

$fieldset->addField('ajax_time_interval', 'text', array(
          'label'     => Mage::helper('dealroom')->__('Page Refresh Time Interval'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'ajax_time_interval',
      ));

I need to set a default value for this text field. I tried, setting 'value'     => '120', in it. But its not working.

$fieldset->addField('ajax_time_interval', 'text', array(
          'label'     => Mage::helper('dealroom')->__('Page Refresh Time Interval'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'ajax_time_interval',
          'value'     => '120',
      ));

How to set a defalt value in that field?


texts: How to add or delete custom option in many products in magento 1.9.3.6?

texts:
is there any feature available in magento to add or remove custom option in many products?

I want to give some free service with product to customer. Customer can select or unselect checkbox whether he wants to get free service with products or not. it's customer choice that's why I want to use custom option. I have added free service in custom option. I want to apply this custom option in many products. How can i do this?

If adding or deleting custom option is not available in magento. is there any other alternative way to achieve this feature?


texts: List all Guest user's Order History in magento 2?

texts:
Create a Magento 2 extension to implement guest order history feature.

Please implement with a new controller that takes parameter(s)
to query a single order and returns a json with information about order status, total, items (sku, item_id, price) and total invoiced.

Use Itdesire as namespace and OrderController as module name. (Itdesire_OrderController)


texts: Sql script foreignn key mapping error magento

texts:
i have 2 tables spen_recipe and spen_recipe_type

spen_recipe has columns

1) recipe_id  PK

2) recipe_type FK

spen_recipe_tpye has columns

1) recipe_type_id  PK

No i have to map recipe_type (FK) from 1st table to recipe_type_id (PK) in 2nd table.

For that i have my script as :

->addForeignKey(
$this->getFkName('vendor_recipe/spen_recipe','recipe_type', 'vendor_recipe/spen_recipe_type','recipe_type_id'),
    'recipe_type',
$this->getTable('vendor_recipe/spen_recipe_type'),
    'recipe_type_id',
Varien_Db_Ddl_Table::ACTION_CASCADE,
Varien_Db_Ddl_Table::ACTION_CASCADE
)

updated full code:

$installer = $this;

$installer->startSetup();

$table = $installer->getConnection()
->newTable($installer->getTable('vendor_recipe/spen_recipe'))
->addColumn('recipe_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'identity'  => true,
    'unsigned'  => true,
    'nullable'  => false,
    'primary'   => true,
    ), 'Recipe ID')
->addColumn('user_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    ), 'USer ID')
->addColumn('recipe_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
    'nullable'  => false,
    ), 'Recipe Name')
->addColumn('recipe_title', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
    'nullable'  => false,
    ), 'User ID')
->addColumn('spen_recipe_type', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    ), 'Recipe Type')
->addColumn('cooking_time', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    ), 'Cooking Time')
->addColumn('preparation_time', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    ), 'Preparation time')
->addColumn('serving_to', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    ), 'Serving to')
->addColumn('recipe_desc', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
    'nullable'  => false,
    ), 'Recipe Description')
->addColumn('recipe_photo', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
    'nullable'  => false,
    ), 'Recipe Photo')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
    'nullable'  => false,
    ), 'Created At')
->addColumn('modified_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
    'nullable'  => false,
    ), 'Modified At')
->addColumn('published_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
    'nullable'  => false,
    ), 'Published At')
 ->addForeignKey(
    $this->getFkName('vendor_recipe/spen_recipe','recipe_type', 'vendor_recipe/spen_recipe_type','recipe_type_id'),
        'recipe_type',
    $this->getTable('vendor_recipe/spen_recipe_type'),
        'recipe_type_id',
    Varien_Db_Ddl_Table::ACTION_CASCADE,
    Varien_Db_Ddl_Table::ACTION_CASCADE
)
->setComment('Spen Recipe Table');

$installer->getConnection()->createTable($table);

I am getting Undefined column "recipe_type".


texts: How to hide page for not logged in customers?

texts:
I've created a page using the CMS which I do not want to be accessible by people who are not logged in.
It's a download page which I want to place in the footer. But when they click on it, it should either redirect them to the log in page or continue to the download page if they are already logged in.
I can't seem to find a solution for this other than buying a plugin, which I do not want.


texts: magento 2: save product error after upgrade from 2.0.7 to 2.1.3

texts:
After upgrading from 2.0.7 to 2.1.3 I am unable to alter any products in the admin.

After going to

Products > Catalog > Select a product
Update a field and Save product

I receive the following sql error after clicking save:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id' in 'NEW', query was: INSERT INTO `catalog_product_entity_int` (`row_id`,`attribute_id`,`value`,`store_id`) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE `row_id` = VALUES(`row_id`), `attribute_id` = VALUES(`attribute_id`), `value` = VALUES(`value`), `store_id` = VALUES(`store_id`)

Not really sure how to debug this, let me know if you have any ideas or sugguestions to gather more information.


texts: Why I Can not override \Magento\Paypal\ModelConfig class Either preference or plugin through in magento2?

texts:
I want to add some more parameters in _mapWppFieldset().

But I am not able to override this config class in magento2

  di.xml

             <?xml version="1.0"?>
             <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
              <preference for="Magento\Paypal\Model\Config" type="Vendor\Paypal\Model\Config" />

  Vendor\Paypal\Model\Config.php

                <?php

             namespace Vendor\Paypal\Model;

         use Magento\Payment\Helper\Formatter;

       class Config extends \Magento\Paypal\Model\Config
      {
         protected function _mapWppFieldset($fieldName)
           {

    switch ($fieldName) {
        case 'api_authentication':
        case 'api_username':
        case 'api_password':
        case 'api_signature':
        case 'sales_api_signature':
        case 'sales_api_username':
        case 'sales_api_password':
        case 'payments_api_signature':
         case 'payments_api_username':
        case 'payments_api_password':
        case 'billing_api_signature':
         case 'billing_api_username':
        case 'billing_api_password':
        case 'account_api_signature':
         case 'account_api_username':
        case 'account_api_password':
        case 'sandbox_api_signature':
         case 'sandbox_api_username':
        case 'sandbox_api_password':
        case 'api_cert':
        case 'sandbox_flag':
        case 'use_proxy':
        case 'proxy_host':
        case 'proxy_port':
        case 'button_flavor':
        case 'button_type':
            return "paypal/wpp/{$fieldName}";
        default:
            return null;
        }
    }

  }


texts:
I followed this
Buy 2 specific products and get one specific product free

But the promotion is not working, when that particualr sku is added to cart the free sku is not added in the cart. The details are given below.

Condition Tab:

If ALL  of these conditions are TRUE :
If an item is FOUND  in the cart with ALL  of these conditions true:
SKU  is one of  sku047, sku030

Quantity in cart  is  2

Action Tab:

Apply Percent of the product price discount

Discount Amount *

100
Maximum Qty Discount is Applied To 0

Discount Qty Step (Buy X) 0

Apply to Shipping Amount no

Free Shipping no

Stop Further Rules Processing no

Gift SKU

Apply the rule only to cart items matching the following conditions (leave blank for all items)

If ALL  of these conditions are TRUE :
SKU  is  sku027


texts:
I am creating a recurring profiles implementation for a payment method. I have create the required functions based on the class Mage_Payment_Model_Recurring_Profile_MethodInterface. My main struggle is how to physically create the new order.

Firstly I tried creating the order from the payment information as this contains order_info, order_item_info, billing_address_info and shipping_address_info. This had a problem when the payment failed that it was not working in the normal checkout way in terms using sales/service_quote and being able to roll back.

My question is this really. How should I work with the recurring profile to create the order "correctly" so that error cases work?

Looking at an example system it seems to simply create the order from the profile using Mage_Sales_Model_Recurring_Profile::createOrder but then in that case how would this work if the payment fails?


texts: How to get color family values for product in magento2?

texts: How to get color family values  and option Id for product in magento2.


texts: How to add custom shipping fields in checkout and save them in database?

texts:
I need to add some fields to the shipping address form and save that fields into database.

Then show in Billing Address and Shipping Address. Please tell me how to do this thing?

Any help will be appreciated.


texts: Get 1 random product from several categories

texts:
For a product page I'd like to show 1 random product from each of the 3 preselected categories. The final layout would be 3 products next to each other (1 from each category). Now I have read several topics about the random product issue, none of them however address the issue of having several single products from different categories.

I started by creating the code that would pick a random product from a specific category:

<?php
$catid = '338';
$category = new Mage_Catalog_Model_Category();
$category->load($catid);
$collection = $category->getProductCollection();
Mage::getModel('catalog/layer')->prepareProductCollection($collection);
$collection->getSelect()->order('rand()');
$collection->addStoreFilter();
$numProducts = 1;
$collection->setPage(1, $numProducts)->load();
?>

<?php foreach($collection as $product): ?>

<?php $product = Mage::getModel('catalog/product')->load($product->getId());
  echo $product->getName();
  echo $product->getShortDescription(); ?>
<?php endforeach; ?>
<?php endif; ?>

This works just fine. What would be the next step to get 1 product from the other 2 categories (say id 339 & 340)?


texts:
How to add my base URL instead of http://localhost/m2
if (data.productid == 'false') {
    window.location.replace("http://localhost/m2/customer/account/login");
}


texts:
On the category page I have a quick shop "Add to Cart" button, which adds one type of the product to the cart for virtual and simple products.
Instead I would like this button to simply make it open the product.
Below is my code;

<?php if($_product->isSaleable()): ?>
    <?php if ( !($_product->getTypeInstance(true)->hasRequiredOptions($_product)
    || $_product->isGrouped()) ): ?>

    <button rel="tooltip" data-placement="top" type="button"
    title="<?php echo $this->__('Add to Cart') ?>" class="btn-cart lort"
    onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')">
    <?php echo $this->__('Add to Cart') ?></button>

How can I change that?


texts: Shop relaunch failed - no orders anymore

texts:
Recently we launched a redesigned shop: www.fumalo.com . Now it passed 1 1/2 months. Since then only one single order has been transacted. The page views broke in with about 50% but is now raising again. The page with highest jump-off is the homepage...strange right?

Before it was also Magento, but just a cheap theme and v1.5 instead of now v1.9.

We checked the functionality of checkout and we took care of url rewrites. The Design is not at its final stage and also the responsive could be better, but hey...its thousand times better then the old theme, even if its not perfect.

So maybe you guys have an answer...maybe its obvious, but I don't see it.

Thanks a lot for feedback


texts:
I am working on simple php script with email functionality which is depends on admin login in magento admin panel. I use this code for check session of admin in my php file.

  if (Mage::getSingleton('admin/session')->isLoggedIn())

But it not provides any thing. Are we able to access magento session outside magento setup or not.I am using php file here.Let me know what i do i need to get session of magento admin outside of magento.


texts: Security Patch SUPEE-11155 - Possible issues?

texts:
Magento has released a new security patch for M1, and updates for M1 and M2.

What common issues do you have to watch out for when applying this patch/upgrade?

Magento 1

https://magento.com/security/patches/supee-11155

Magento 2

This should be the last release in the 2.1 series which reaches its EOL at the end of this month.

https://magento.com/security/patches/magento-2.3.2-2.2.9-and-2.1.18-security-update-13
https://github.com/magento/magento2/releases/tag/2.1.18
https://github.com/magento/magento2/releases/tag/2.2.9
https://github.com/magento/magento2/releases/tag/2.3.2


texts: In the settings I have a website and how can I find out MAGE_RUN_CODE, which I will inscribe in .htaccess?


texts:
Can I set minimum grandtotal amount to $1 so customer cannot checkout if the grand total is less than $1.

Suppose the subtotal is $5 and customer applied any promo code and get 4.50 as discount and now the grand total is $.50.

But we want to restrict so they cannot do checkout, even not with paypal or any payment gateway.


texts:
with my company, we are trying to upload our extension to Magento 2 Marketplace. At the moment it works properly but only downloadable from our site. When I've tried to submit it, the first problem appears - different structure ( composer.json not found), it looks like package for upload should contain only module directory ("integration") without Vendor directory, but is it correct? Without vendor directory, every path in classes will crash... How does it work? Maybe marketplace generates it dynamically or something?

I was looking for help on official sites but without success...


texts: Enabling Paypal Pro and Paypal Standard at the same time

texts:
I would like to accept Paypal pro credit card orders, and Paypal payments.

The problem is that Paypal Express which is enabled by default with Pro, redirects the customer before they complete the Magento checkout process, which on my site includes further data capture.

I have followed the points here:
Enable Paypal Pro & Standard in Magento 1.7

This does indeed work for the front end, unfortunately in the back end Magento shows orders as pending payment, even when they are paid. I'm guessing this is because Paypal Standard isn't actually active in the back end, anyone know how I can activate it?


texts: How to stop sale order confirmation email on specific payment Method in magento 2

texts:
I want to stop the order confirmation email on a specific payment method.

I can't achieve exactly which module perform email sending task and in
which controller where I apply condition(email, sale, checkout).

Please help me as soon as possible.


texts: Magento 2 - Full hierarchy wise product breadcrumb

texts:
If I open a product directly from Home or search page then breadcrumb shows like this:

  Home > MyProduct

Whereas if I go to the category, then subcategory and then open the product, it show the Breadcrumb like this:

  Home > Category1 > Category2 > MyProduct

I need to make the breadcrumb with full hierarchy regardless of from where I am coming to product page.

Please help me achieve this


texts: By submitting forms billing and shipping, return message "Telephone this required field"

texts:
When I fill out the form and send to customer base, magento returns the message Telephone is a required field

I've tried removing the validation of the phone field in HTML, JS and Databases, yet still blocking me the customer base.

It sends the value of the completed field, but still returns a message that is a required field


texts: EntityManager is trying to insert an existing row instead of updating the row

texts:
I have an extension property on Magento's Invoice class, and I'm trying to make an API method that sets the value of my extension attribute for a specific invoice.  I'm using my class as an extension attribute when I get an invoice through the API, but in this example I just want to be able to quickly set its value without retrieving my invoice, setting its extension attribute, and then saving the entire invoice (since only the extension attribute changed).

My extension attribute has three columns:

entity_id (primary key)
invoice_id (foreign key to sales_invoice with unique constraint)
my_value

If my extension attribute doesn't already exist in the database table, this works correctly and inserts a row for my extension attribute for that invoice ID.  However, if a row for that invoice ID already exists, it seems like this code tries to insert that row again rather than update the existing row.

How do I get this code to update the existing row, rather than try to insert a new row for an existing instance of my extension attribute?

interface MyExtensionInterface extends ExtensibleDataInterface
{
    const ENTITY_ID = "entity_id";
    const INVOICE_ID = "invoice_id";

    // Foreign key to the sales_invoice table
    public function getInvoiceId();
    public function setInvoiceId();

    public function getMyValue();
    public function setMyValue();

    public function getExtensionAttributes();
    public function setExtensionAttributes(\MyCompany\MyExtensionAttribute\Api\Data\MyExtensionInterface $extensionAttributes);
}

class MyProvider implements MyExtensionProviderInterface
{
    public function __construct
    (
        EntityManager $entityManager,
        Loader $loader,
        MyExtensionFactory $myExtensionFactory
    ) {
        $this->entityManager = $entityManager;
        $this->loader = $loader;
        $this->myExtensionFactory = $myExtensionFactory;
    }

    // This is the method where I want to update the extension attribute's
    // value, and then update it in the database
    public function setMyExtensionValue($invoiceId, $value)
    {
        $ids = $this->loader->getMyExtensionAttributeByInvoiceId($invoiceId);

        if (count($ids) > 0)
        {
            $id = $ids[0];
            $myExtension = $this->myExtensionFactory->create();
            $this->entityManager->load($myExtension, $id);
        }
        else
        {
            $myExtension = $this->myExtensionFactory->create();
            $myExtension->setInvoiceId($invoiceId);
        }

        $myExtension->setMyValue($value);

        // This is where I'm getting an unique constraint violation
        $this->entityManager->save($myExtension);
    }
}

class Loader
{
    private $metadataPool;
    private $resourceConnection;

    public function __construct
    (
        \Magento\Framework\EntityManager\MetadataPool $metadataPool,
        ResourceConnection $resourceConnection
    ) {
        $this->metadataPool = $metadataPool;
        $this->resourceConnection = $resourceConnection;
    }

    public function getMyExtensionAttributeByInvoiceId($invoiceId)
    {
        $metadata = $this->metadataPool->getMetadata(MyExtensionInterface::class);
        $connection = $this->resourceConnection->getConnection();
        $select = $connection
            ->select()
            ->from($metadata->getEntityTable(), MyExtensionInterface::ENTITY_ID)
            ->where(MyExtensionInterface::INVOICE_ID . ' = ?', $invoiceId);
        $ids = $connection->fetchCol($select);
        return $ids ?: [];
    }
}


texts:
What is the use of index in table creation in magento2

  ->addIndex($installer->getIdxName('blog_comment', ['parent_id']),      ['parent_id'])

Thanks


texts: Magento form validation doesn't work as user type in

texts:
I have added form validation for the customer address form.
but the issue is, validation works when I click submit button, it should work as user types in(key-up).

  city text box

<input type="text" name="city" value="" title="City" class="input-text required-entry mage-error" id="city" data-validate="{required:true, 'validate-alphanum-with-spaces':true}" sr-only="INPUT" for="INPUT" aria-required="true" aria-invalid="true" aria-describedby="city-error">

  postcode text box

<input type="text" name="postcode" value="" title="Zip/Postal Code" id="zip" class="input-text validate-zip-international required-entry mage-error" data-validate="{required:true, 'validate-alphanum-with-spaces':true}" sr-only="INPUT" for="INPUT" aria-required="true" aria-invalid="true" aria-describedby="zip-error">

script

<script type="text/x-magento-init">
{
    "#form-validate": {
        "addressValidation": {}
    },
    "#country": {
        "regionUpdater": {
            "optionalRegionAllowed": <?= /* @noEscape */ $block->getConfig('general/region/display_all') ? 'true' : 'false' ?>,
            "regionListId": "#region_id",
            "regionInputId": "#region",
            "postcodeId": "#zip",
            "form": "#form-validate",
            "regionJson": <?= /* @noEscape */ $this->helper(\Magento\Directory\Helper\Data::class)->getRegionJson() ?>,
            "defaultRegion": "<?= (int) $block->getRegionId() ?>",
            "countriesWithOptionalZip": <?= /* @noEscape */ $this->helper(\Magento\Directory\Helper\Data::class)->getCountriesWithOptionalZip(true) ?>
        }
    }
}

What can be the issue?


texts: Magento 2 : How Can I Override Step-Navigator File From Checkout

texts:
I want to override step-navigator js file. I had followed this method How to extend js class/method of checkout model class in magento 2 but it didn't work. any help.

I want to override this method.

navigateTo: function (code, scrollToElementId) {

    },

My code in require js file

var config = {
'config': {
'mixins': {
    'Magento_Checkout/js/view/shipping': {
        'Av_ShoppingCart/js/view/shipping-payment-mixin': true
    },
    'Magento_Checkout/js/view/payment': {
        'Av_ShoppingCart/js/view/shipping-payment-mixin': true
    },
    'Magento_Checkout/js/model/step-navigator': {
            'Av_ShoppingCart/js/model/step-navigator': true
     }
}

}

My code of customizing step-navigator file

define(function () {
'use strict';

return function (target) {
    var navigateTo = target.navigateTo;
    target.navigateTo = function(code, scrollToElementId) {

        alert("safasfaf");

        var result = navigateTo.apply(this, arguments);
        // //after method call
        return  result;
    };
    return target.
};

});


texts: Top menu show only subcategories of a specific category

texts:
These are my categories :

Root category
---> Shoes
---- ---> Red    shoes
---- ---> Green  shoes
---- ---> Yellow shoes
---> Shirts
---- ---> Black shirts
---- ---> White shirts
---- ---> Blue  shirts

and my top menu would be like:

-Shoes         -Shirts

But I only want to show my shoes in the top menu, Like this :

-Red shoes    -Green shoes    -Yellow shoes

How can I do that?


texts: How to write file on another server in magento2

texts:
I want to create/write file on another server using Magento

Ex:
my site : www.test.com (Magento2site i want to write code here to generate file on www.testTEst.com)


texts:
I am new to magento web services, but i want to create create or use web services.
So any one help to guide where to start and how to check,

As i have created user for web services and i don't know how to check the magento web services.

I have searched lot i am getting the codes but i don't know where to place these codes and how to check.

This may be silly question,
I need help on this.

thanks in advance.


texts: Magento2 how to set multiple custom attribute

texts:
I am creating new products via code. I want to save a product that has a custom attribute with multiple values. So the attribute property input type is a Multiple Select (nomo_color). I know how to save a single attribute property via the method

  $product->setCustomAttribute('attribute_code', id)

But how would I do this if I should save multiple values ?

I tried iterating over the values and calling the method multiple times. This doesn't work and only saves the last value.

This is my Code

$product = $this->productFactory->create();
$type = $result[2];
$article = $result[1];
$size = $result[3];
$color = $result[4];

$qualities = isset($result[7]) ? $this->formatQualityText($result[7]) : [];
$colorValues = isset($result[5]) ? $this->formatColorText($result[5]) : [];

$sku = $article.'-'.$color.'-'.$size;
$name = $article . ' - ' . $color . ' - ' . $type . ' - ' . $size;
$price = (float) isset($result[6]) ? $result[6] : 0;

$product->setSku($sku);
$product->setName($name);
$product->setPrice($price);

if ( ! empty($colorValues)) {
    foreach($colorValues as $value) {
        $product->setCustomAttribute('nomo_color', $this->attributeHelper->createOrGetId('nomo_color', $value));
    }
}

if ( ! empty($color)) {
    $product->setCustomAttribute('color', $this->attributeHelper->createOrGetId('color', $color));
}

$this->productRepository->save($product);


texts: Same Server, Change just website address

texts:
I'm considering to change our store website address

Is there any link or info I should check before/while changing address?

I don't move server. Server is same. I just want change my domain address


texts: Magento: inside pages showing 404 after migrate

texts:
I have recently migrated Magento into a subfolder on a different server. I have, after that, created a symlink on the new server; I have done this because I want to have multiple shops running off the main folder.

The problem is that while homepage is working fine if I am to click on any internal links I am presented with 404 page.
Also, on the homepage, products dont have images.

In the .htaccess I have added few extra lines

RewriteBase /magento/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /magento/index.php [L]


texts: Retrieve cronjob_code or other params like schedule info of a cron job inside a cron function?

texts:
If cron_job() is my function running the cron job

function cron_job(){
     // I would like to get the current job_id or the cron schedule model here
}

Is there any way to retrieve this data in Magento version > 1.9


texts: I have developed an e-commerce website using magento. I want to add recommender systems using Prediction.i.o. Can somebody tell me the steps to do it?


texts:
I have created a module which uses a Observer for the event 'checkout_onepage_controller_success_action'

I need to get the list of items in the order and get a custom attribute (the type is text).

So far I can load the order and get all items in that order:

$orderIds = $observer->getEvent()->getOrderIds();
$order = Mage::getModel('sales/order')->load($orderIds);
$ordered_items = $order->getAllItems();

So far to get some of the attributes for each item in the order I do this:

foreach ($ordered_items as $item) {
    echo $item->getName()."<br />";
    echo $item->getSku();
}

These values are displaying fine. The problem is each product has a custom attribute with the code 'isbn_10' but I can't get the value to display. Some code I've tried is:

$item->getAttributeText('isbn_10');
$item->getIsbn10();
$item->getResource()->getAttribute('isbn_10')->getFrontend()->getValue($item);

Any help is much appreciated. Thanks.


texts: Magento 2 : Critical exception using WebAPI (Add To Cart)

texts:
To reproduce the issue, here are my steps :

First I get the customer Token using :

  http://.../rest/default/V1/integration/customer/token

I create a cart

  http://.../rest/default/V1/carts/mine

Add add to cart

  http://.../rest/default/V1/carts/mine/items

Everything works fine, I can checkout and complete my order.

Then, after this checkout, I want to continue my shopping and do the same steps.

Get customer token : OK
Create a cart : OK
But when I add to cart, I got the following exception :

[2018-05-11 14:19:03] main.CRITICAL: Report ID: webapi-5af5a657dfda8; Message: Class float does not exist {"exception":"[object] (Exception(code: -1): Report ID: webapi-5af5a657dfda8; Message: Class float does not exist at C:\...\magento2\lib\internal\Magento\Framework\Webapi\ErrorProcessor.php:205, ReflectionException(code: -1): Class float does not exist at C:\...\magento2\lib\internal\Magento\Framework\Reflection\MethodsMap.php:155)"} []

Any idea what could be the issue?

Thanks


texts:
I want to adapt the mini search to search for product tags rather than name.

Which files and code will I need to change to achieve this?


texts: Add new Mobile Number field in magento(1.9) customer registration form

texts:
I want to add Mobile number field to customer registration form. So that user can login with help of email id or mobile number.

https://www.magentocommerce.com/magento-connect/custome-account-profile-13594.html

I have tried this extension but it shows me an error.

I have tried creating simple custom extension "Hello World" but don't have experience to write any useful extension .

Can you please give some idea related to my requirement?


texts: Orders coming through without shipping method selected/no shipping charge

texts:
Running Magento 1.8. Twice in the last year orders have come through without any shipping charges. We use a mixture of table rates and calculated rates.

Anyone else ever see this? Any ideas? We just were informed of the orders and it's been over a month since the last one.


texts: Stop ability to load site as both example.com and example.com/index.php

texts:
I've just noticed that I can load pages within and without index.php in the URL.

So, I can load these URLs:

example.com
example.com/index.php (I don't want this)
example.com/product.html
example.com/index.php/product.html (I don't want this)

I'm running M2+Apache, and would like to know how to stop this from happening.digital


texts: Magento 2: Shipment Email gives Missing required argument $debugHintsPath

texts:
I'm sending shipment using below code

magento\vendor\magento\module-shipping\Controller\Adminhtml\Order\Shipment\Save.php

$this->shipmentSender->send($shipment);

Error

Fatal error: Uncaught exception 'BadMethodCallException' with message 'Missing required argument $debugHintsPath of Magento\Developer\Model\TemplateEngine\Plugin\DebugHints.' in D:\wamp\www\
magento\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php:45
Stack trace:
#0 D:\wamp\www\magento\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\
Develop...', Array, Array)
#1 D:\wamp\www\magento\vendor\magento\framework\ObjectManager\ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Develop...')
#2 D:\wamp\www\magento\vendor\magento\framework\Interception\PluginList\PluginList.php(233): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Develop...')
#3 D:\wamp\www\magento\vendor\magento\framework\Interception\Interceptor.php(151): Magento\Framework\Interception\PluginList\PluginList->getPlugin('Magento\\Framewo...', 'd in D:\wamp\
www\magento\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php on line 45

Withing Magento I'm not getting any issue. I'm making my custom script in only that I'm getting this error.


texts: Different domain for different store view (language)

texts:
Is it possible to have different views of my site (for languages / currencies) hosted off different domains

for example:

www.myshop.co.uk - English (GBP) version of the site
www.myshop.ie - English (EUR) (Irelenad) Version of the site
www.myshop.fr - French (EUR) Version of the site

I would use hreflang attribute on each page to denote languages etc...


texts: Magento 2: Why Does My Custom Controller Generate an Interceptor?

texts:
I recently created a basic routing configuration for a test module

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="standard">
        <route id="helloworld" frontName="helloworld">
            <module name="Pulsestorm_Helloworld" />
        </route>
    </router>
</config>

and then created a controller file at

app/code/Pulsestorm/Helloworld/Controller/Index/Index.php

Everything work as expected -- but I was surprised to discover that Magento had automatically created an interceptor for my new controller.

var/generation/Pulsestorm/Helloworld/Controller/Index/Index/Interceptor.php

I didn't configure any plugins for my controller -- so I'm little confused as to why Magento generated an interceptor.

What makes Magento 2 automatically create an Interceptor for new controllers?


texts: Magento 2.2.5 styles-m.css and styles-l.css not load

texts: I'm working with new project and editing front-end css (working with less files), everything goes well but suddenly styles-m.css and styles-l.css in front-end not loading. Any ideas why this happened to me and how to solve this problem?


texts: Magento2.3.3 Layered navigation filters are not working properly

texts:
We recently upgraded from magento 2.2.7 to 2.3.3
We have an issue when we click on any filters at PLP.
The filter parameters are getting stripped from the URL and it redirects back to Original PLP page.

For example when we click on size filter it should go to http://store.base.url/dresses/?size=10. But it redirecting back to httP//store.base.url/dresses/


texts: Scriptaculous is making my website very slow

texts:
I am -very- unfamiliar with Magento development. I know how to do things via the graphical interface, but editing any code goes completely over my head. I am familiar with HTML and CSS and I can understand PHP and JS, so code isn't that foreign to me.

Anyway, my store loads very slowly. I ran a Pingdom speed test and it looks like scriptaculous is taking a long time to load.

I did some research and it looks like this has to do with the core functionality of Magento, but some people were asking if they need it? I'm not sure if my store would still work without it.

The URL is http://satcogrowlight.com. I have one theme installed and two extensions, one is Bassi slider and another is Dimensional Shipping.

How can I find out if I need Scriptaculous? If I don't need it, how can I disable it?

(Disclaimer: several things are making my website slow and I am looking into the other sources as well)

Thank you!

Edit: upon further research, looks like compressing it might help? How do I do that (if it's even possible)?

Edit: According to the Google PageSpeed tool, "Your page has 25 blocking script resources and 13 blocking CSS resources. This causes a delay in rendering your page.
None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML."

js/prototype/prototype.js
js/lib/ccard.js
js/prototype/validation.js
js/scriptaculous/builder.js
js/scriptaculous/effects.js
js/scriptaculous/dragdrop.js
js/scriptaculous/controls.js
js/scriptaculous/slider.js

Again, my question is: do I need Scriptaculous? If I don't need it, how can I disable it?


texts: 1.9: programatically switch CMS page template in Observer

texts:
For a bunch of reasons, I'd like to be able to switch a CMS page's template based on some PHP.

In config.xml:

<frontend>
        <events>
            <controller_action_layout_load_before>
                <observers>
                    <Ecomm_Search_set_root_template>
                        <type>singleton</type>
                        <class>Ecomm_Search/observer</class>
                        <method>setRootTemplate</method>
                    </Ecomm_Search_set_root_template>
                </observers>
            </controller_action_layout_load_before>
        </events>
    </frontend>

in local.xml:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <set_root_template>
        <reference name="root">
             <action method="setTemplate"><template>page/new_template.phtml</template></action>
        </reference>
    </set_root_template>
</layout>

In Observer.php:

public function setRootTemplate(Varien_Event_Observer $observer) {
    //some other logic goes here
    $layout = $observer->getEvent()->getLayout()->getUpdate();
    $layout->addHandle('set_root_template');
    return $this;
}

Everything is running/working as expected, but the template doesn't switch.  what am I missing here? is there some other thing overriding what I do because it runs last?


texts:
how to fix confliction of Custom Option is required yes with bundle item?

In Bundle Product grid have displayed all product as bundle items but not save some product because that product has the custom option is required field as YES.


texts: Installing Magento using Xamp on Ubuntu gives this error

texts:
I installed Xamp and in htdocs I created a folder named magento. I unpacked the magento installer into the folder named magento.
When I start the sever and go to localhost/magento I get this error:
Warning: require(/opt/lampp/htdocs/magento/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/magento/vendor/composer/autoload_real.php on line 70

Fatal error: require(): Failed opening required '/opt/lampp/htdocs/magento/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='/opt/lampp/htdocs/magento/vendor/magento/zendframework1/library:.:/opt/lampp/lib/php') in /opt/lampp/htdocs/magento/vendor/composer/autoload_real.php on line 70

How do I fix it ?
I tried following the instructions here in the SO query below and it didn't work.
https://askubuntu.com/questions/604522/install-composer-and-configure-with-xampp
Thank you!


texts: Where are pages and blocks created in the admin section stored?

texts:
I have created blocks in the Magento Admin GUI as well as in the frontend/.../templates directory. Both have been tested and they work fine.

My question are:

Where do the blocks and pages that you create in the Magento Admin back-end get stored?
Is it in the database?
Is it in a directory that I can go into manually and see them?

If the answer turns out to be that they are all strictly stored in the DB, could you please guide me through accessing them/their location in the DB?

I will most likely have to move all the files in the near future to a completely different system and would like to make sure I do not lose anything.


texts: Magento 2 - How to hidden field of customer edit page

texts: How to hidden field of customer edit page  in magento 2


texts: Restricting access to anonymous web APIs

texts:
As given in the documentation here : http://devdocs.magento.com/guides/v2.0/rest/anonymous-api-security.html
By default magento 2 only restrict Catalog, Store and CMS API from anonymous users.

In a same way how I can restrict access for all the available API's in magento 2?

The reason is I am building an Mobile app and website based on Angular and I wanted that only my app and website should have access to all the API.


texts: Custom module's layout not redering products in frontpage..blank page no errors

texts:
I have 3 modules overridden from

CatalogSearch,

Catalog and

LayeredNaviagation

In my 4th module, i just need to render the products after hitting the below URL(page shows blank) which is rendering from the 1st 3 modules properly.

http://localhost:1338/magento2x_3/merchandisingpage/result/index/product/test

UPDATED

etc/frontend/router

route id="merchandisingpage" frontName="merchandisingpage"

etc/di.xml

//Have given the preference type for all the modules overridden in 1st 3 modules.
//Need clarification as this can be done!

4th module Vendor\Module\Controller\Result\Index.php

class Index extends \Magento\Framework\App\Action\Action
{
   public function execute()
   {
      $query = $this->request->getParam('q');
    $q = $this->request;
    $re =  array();
    $re = $q->getParams();

    $re['filters'] = true;
    $re['q'] = $re['product'];
     unset($re['product']);
    $payload = $re;
      ....
   }
}

\Vendor\Module\view\frontend\layout\merchandisingpage_result_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="3columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <action method="setTitle">
        <argument name="title" xsi:type="string">Merchandising</argument>
    </action>
</head>
<body>
    <referenceBlock name="search.result">
      <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_Module1::result.phtml</argument>
      </action>
    </referenceBlock>
    <referenceBlock class=" before="-" name="catalogsearch.leftnav">
      <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_Module2::layer/view.phtml</argument>
      </action>
    </referenceBlock>
    <referenceBlock class=" name="product_list_toolbar" >
      <action method="setTemplate">
        <argument name="template" xsi:type="string">Vendor_Module3::product/list/toolbar.phtml</argument>
      </action>
    </referenceBlock>
</body>

I need to get the products rendered in frontpage.

I get blank screen, without errors or exception.


texts: Magento registration date of birth in one field

texts:
I want that in my customer regitration form date of birth field to be in one field. Now it's in 3  fields.
So I have

<div class="input-box customer-dob">
    <input type="text" id="<?php echo $this->getFieldId('dob') ?>" name="<?php echo $this->getFieldName('dob') ?>"
           class="input-text validation-custom required-entry"/>
</div>

But validation don't working. Have you any idea?


texts: The message block is missing in list.phtml. If redirect to cart after product add is disabled, the customer will get no message. Simply adding the block in list.phtml won't work however.


texts: SOLVED - Magento Layout File Doesn't Work

texts:
I have created a module and when I put its block in magento catalog.xml it shows up. But when I place the code in my module's productcomments.xml layout file, it doesn't show anything.
Can anyone help me with this?
Thanks in advance!

Here is the config.xml

<config>
    <modules>
        <Cpstest_ProductComments>
            <version>0.1.0</version>
        </Cpstest_ProductComments>
    </modules>
    <frontend>
        <layout>
            <updates>
                <productcomments>
                    <file>productcomments.xml</file>
                </productcomments>
            </updates>
        </layout>
        <routers>
            <productcomments>
                <use>standard</use>
                <args>
                    <module>Cpstest_ProductComments</module>
                    <frontName>productcomments</frontName>
                </args>
            </productcomments>
        </routers>
    </frontend>
    <global>
        <resources>
         <productcomments_setup>
                <setup>
                    <module>Cpstest_ProductComments</module>
                    <class>Mage_Eav_Model_Entity_Setup</class>
                   <class>Cpstest_ProductComments_Model_Resource_Mysql4_Setup</class>
                    <class>Mage_Catalog_Model_Resource_Setup</class> <!---->
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </productcomments_setup>
            <productcomments_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </productcomments_write>
            <productcomments_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </productcomments_read>
        </resources>
        <helpers>
            <productcomments>
                <class>Cpstest_ProductComments_Helper</class>
            </productcomments>
        </helpers>
    </global>
</config>

This is productcomments.xml

<?xml version="1.0"?>
    <catalog_product_view>
       <reference name="content">
            <reference name="product.info">
                 <block type="catalog/product_view_attributes" name="product.comments" as="additional" template="productcomments/productcomments.phtml">
                    <action method="setTitle" translate="value"><value>Product Comments</value></action>
                </block>
            </reference>
       </reference>
    </catalog_product_view>
</layout>

And the working code in catalog.xml is:

<catalog_product_view translate="label">
     <reference name="content">
     <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
     <block type="catalog/product_view_attributes" name="product.comments" as="additional" template="productcomments/productcomments.phtml">
     <action method="setTitle" translate="value"><value>Product Comments</value>     </action>
 </block>
.....


texts: API salesOrderInvoiceCreate throws: SOAP-ERROR: Encoding: object has no 'invoiceIncrementId' property

texts:
I am doing a simple create invoice. I am getting this Fatal Error:

  Fatal error: SOAP-ERROR: Encoding: object has no 'invoiceIncrementId' property

It shouldn't need an invoiceIncrementId, but it is throwing an error requiring one. I can't find anything online about this, not sure what is going on. Any ideas?

/** create invoice */
$magentoClient = MagentoClient::sharedClient();
$invoicecreate_request = $magentoClient->salesOrderInvoiceCreate(
    (object)array(
        'sessionId' => $magentoClient->sessionId,
        'orderIncrementId' => $order_id,
        'itemsQty' => array(
            'order_item_id' => (string) $orderinfo_request->result->items->complexObjectArray->item_id,
            'qty'           => (string) $orderinfo_request->result->items->complexObjectArray->qty_ordered
        ),
        'comment' => 'Created by Shopkeeper at '.date('Y-m-d H:i:s'),
        'email' => null,
        'includeComment' => null
    )
);

The WSDL does indeed show it requires an invoiceIncrementId.

<xsd:element name="salesOrderInvoiceCreateRequestParam">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string"/>
<xsd:element minOccurs="1" maxOccurs="1" name="invoiceIncrementId" type="xsd:string"/>
<xsd:element minOccurs="1" maxOccurs="1" name="itemsQty" type="typens:orderItemIdQtyArray"/>
<xsd:element minOccurs="0" maxOccurs="1" name="comment" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="email" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="includeComment" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

Unfortunately, the docs do not.

$result = $proxy->salesOrderInvoiceCreate((object)array(
    'sessionId' => $sessionId->result,
    'orderIncrementId' => '200000008',
    'itemsQty' => array('order_item_id' => 15, 'qty' => '1'),
    'comment' => null,
    'email' => null,
    'includeComment' => null
));

I must be misunderstanding something, but that's how this appears.


texts: Catalog Price Rules: "Stop Further Rules Processing' (not cart rules) - how does this work? M1

texts:
Catalog Price Rules: "Stop Further Rules Processing" (not cart rules) - how does this work?

So, How does "Stop Further Rules Processing" work?

does this work in product level? set a flag: stop further rules processing only for the "affected" products by the current rule? (so: all rules, but products are affected only once by the first rule touching them)
Does it mean: stop processing of any other rule. So no rules with lower prior and no other rules with the same prior (so: only the 1 rule)
Does this mean: stop processing of all other rules with a lower prior - but do finish all rules with the same prior? (so: only 1 rule + the rules with the same prior)

Example situation

2 rules 1 with PRIO 10 other with PRIO 2. Rule 1 has stopped further processing: what does this do?
10 rules all with PRIO 10 and 15 other with PRIO 2. The first rule of 10 rules with PRIO 10 has stopped further processing: what does this do?

Reference is taken from Magento

https://docs.magento.com/m1/ce/user_guide/marketing/price-rules-catalog.html

  If you want to stop the processing of other rules after this rule has
  been applied, set Stop Further Rules Processing to “Yes.” This
  safeguard prevents customers from receiving multiple discounts for the
  same product.

I am thrown off by the part "for the same product" which hints at some kind of rule stopping on the product level: read stop further rules processing is only applicable to the 1st product that it matches And does not match a second rule) however a product not affected by the first rule, may be affected by the 2nd rule


texts: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'core_store' doesn't exist

texts:
Appreciate if anyone could help me out, as I've been searching for a solution for hours, but they are all pretty vague.

When I attempt to access my website receive the following error:

  There has been an error processing your request  SQLSTATE[42S02]: Base
  table or view not found: 1146 Table 'shopstel_magento.core_store'
  doesn't exist  Trace: #0
  /home/shopstel/public_html/lib/Zend/Db/Statement.php(300):
  Zend_Db_Statement_Pdo->_execute(Array) #1
  /home/shopstel/public_html/lib/Zend/Db/Adapter/Abstract.php(479):
  Zend_Db_Statement->execute(Array) #2
  /home/shopstel/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238):
  Zend_Db_Adapter_Abstract->query('SELECT main_ta...', Array) #3
  /home/shopstel/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333):
  Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
  #4
  /home/shopstel/public_html/lib/Zend/Db/Adapter/Abstract.php(734):
  Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
  #5
  /home/shopstel/public_html/lib/Varien/Data/Collection/Db.php(779):
  Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select), Array)
  #6
  /home/shopstel/public_html/lib/Varien/Data/Collection/Db.php(696):
  Varien_Data_Collection_Db->_fetchAll(Object(Varien_Db_Select)) #7
  /home/shopstel/public_html/lib/Varien/Data/Collection/Db.php(617):
  Varien_Data_Collection_Db->getData() #8
  /home/shopstel/public_html/app/code/core/Mage/Core/Model/Mysql4/Store/Collection.php(137):
  Varien_Data_Collection_Db->load(false, false) #9
  /home/shopstel/public_html/lib/Varien/Data/Collection.php(740):
  Mage_Core_Model_Mysql4_Store_Collection->load() #10
  /home/shopstel/public_html/app/code/core/Mage/Core/Model/App.php(581):
  Varien_Data_Collection->count() #11
  /home/shopstel/public_html/app/code/core/Mage/Core/Model/App.php(429):
  Mage_Core_Model_App->_initStores() #12
  /home/shopstel/public_html/app/code/core/Mage/Core/Model/App.php(335):
  Mage_Core_Model_App->_initCurrentStore('', 'store') #13
  /home/shopstel/public_html/app/Mage.php(627):
  Mage_Core_Model_App->run(Array) #14
  /home/shopstel/public_html/index.php(80): Mage::run('', 'store')
  #15 {main}

After reading many websites, I understand that Magento is trying to grab a table, that does not exist (for some reason). I have not updated/changed my website for a year or so, and I even asked my host to restore my database to last year, but the error message is still appearing.

I am not an expert at coding, but I can follow specific instructions. Ideally I would like to remove the error without reinstalling Magento. I have read somewhere too that core_store is a simple table. Someone please help me to solve this problem. Let me know if you need any more information from me. Thank you so much and appreciate your time!


texts: Need to add decimal column in existing table

texts:
I want to add new decimal column in sales_order_item table, I got this error when i run upgrade:setup command run. https://www.screencast.com/t/yGFPIhPJz

Is this below code correct? Please help me

$tableName = $setup->getTable('sales_order_item');
            if ($setup->getConnection()->isTableExists($tableName) == true) {
                $columns = [
                    'extra_weight' => [
                        'type'      => [\Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL, '10,2'],
                        'nullable'  => true,
                        'default'   => 0.00,
                        'comment'   => 'Item extra Weight'
                    ]
                ];
                $connection = $setup->getConnection();
                foreach ($columns as $name => $definition) {
                    $connection->addColumn($tableName, $name, $definition);
                }
            }


texts: I am planning to allow the guest user to be able to view the product catalog.  But I would like them not to see the prices.  Is there a way to do that?


texts:
Magento 1.9 dupe entry for UNQ_OZSS_SALES_FLAT_ORDER_INCREMENT_ID (cannot create new order)
In the past we had a store with store id = 23, orders start with 23xxxxxxxxx for increment id
This store was deleted long ago
NOw we created a new store, somehow it got store id = 23
Only the problem is that we cannot create orders because order 230000001 until 2300000022 already exist in sales_flat. Actually 16 orders exist, with some increment_ids missing (e.g. 2300000007 and 2300000010 do not exist)
question: How can we solve this issue? set some increment counter to continue @ 2300000023 or to delete the old orders (if so how)?
Order saving error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2300000010' for key 'UNQ_OZSS_SALES_FLAT_ORDER_INCREMENT_ID', query was: INSERT INTO sales_flat_order (coupon_code, protect_code, shipping_description, is_virtual, store_id, customer_id, base_discount_amount, base_grand_total, base_shipping_amount, base_shipping_tax_amount, base_postnl_cod_fee, base_postnl_cod_fee_tax, base_subtotal, base_tax_amount, base_to_global_rate, base_to_order_rate, discount_amount, grand_total, shipping_amount, shipping_tax_amount, postnl_cod_fee, postnl_cod_fee_tax, store_to_base_rate, store_to_order_rate, subtotal, tax_amount, total_qty_ordered, customer_is_guest, customer_note_notify, customer_group_id, quote_id, base_shipping_discount_amount, base_subtotal_incl_tax, shipping_discount_amount, subtotal_incl_tax, weight, customer_dob, increment_id, applied_rule_ids, base_currency_code, customer_email, customer_firstname, customer_lastname, customer_middlename, customer_prefix, customer_suffix, customer_taxvat, discount_description, global_currency_code, order_currency_code, remote_ip, shipping_method, store_currency_code, store_name, x_forwarded_for, customer_note, created_at, updated_at, total_item_count, customer_gender, hidden_tax_amount, base_hidden_tax_amount, shipping_hidden_tax_amount, base_shipping_hidden_tax_amnt, shipping_incl_tax, base_shipping_incl_tax, gift_message_id, gua_client_id, payment_fee_amount, base_payment_fee_amount, payment_installment_fee_amount, base_payment_installment_fee_amount, gua_ua, payment_fee_tax, base_payment_fee_tax, payment_percentage_fee, base_payment_percentage_fee, mailchimp_campaign_id, mailchimp_abandonedcart_flag, mailchimp_landing_page, mollie_mpm_payment_fee, base_mollie_mpm_payment_fee, mollie_mpm_payment_fee_tax, base_mollie_mpm_payment_fee_tax) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '2021-01-13 08:45:10', '2021-01-13 08:45:10', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Update: clicked create new order, back, create new order, back until we reached 230000025 that was not used. Success: order creation works. Only now we cannot invoice, because the error is "unable to save invoice"
Help appreciated ;)


texts: Unused or misunderstood trait usage in Catalog/Controller/Product.php?

texts:
In the Magento\module-catalog\Controller\Product.php file there is a line:

use Magento\Catalog\Model\Product as ModelProduct;

I see no reference to the Product model in the code and none of the functions seem to be used from the model file. Am I missing something or is this trait call redundant?

<?php
/**
 * Product controller.
 *
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Catalog\Controller;

use Magento\Catalog\Controller\Product\View\ViewInterface;
***

  use Magento\Catalog\Model\Product as ModelProduct;

abstract class Product extends \Magento\Framework\App\Action\Action implements ViewInterface
{
    /**
     * Initialize requested product object
     *
     * @return ModelProduct
     */
    protected function _initProduct()
    {
        $categoryId = (int)$this->getRequest()->getParam('category', false);
        $productId = (int)$this->getRequest()->getParam('id');

        $params = new \Magento\Framework\DataObject();
        $params->setCategoryId($categoryId);

        /** @var \Magento\Catalog\Helper\Product $product */
        $product = $this->_objectManager->get('Magento\Catalog\Helper\Product');
        return $product->initProduct($productId, $this, $params);
    }
}


texts: Magento get payment date in a custom report grid

texts:
I want to add "the date that customer paid the bill" to a report grid for "sales_flat_order_item" table.

For getting result,I have to join two tables "sales_flat_order_status_history" and "sales_flat_order" , before joining them to "sales_flat_order_item".

Now I have two questions :

1- Is there anyway to join two tables before joining them to the collection in magento?

If the answer is NO :

2- How can I add the payment date to my grid?


texts: Problems with Unstyled Page, Bad Paths, loss of layout configuration after application of SUPEE-6788 Patch

texts:
We're running a Magento site, EE 1.14.1 and are having seemingly random problems with the site going down because all of the assets fail to load and the site reverts from our theme to the default enterprise theme (!!) -- all of our customized layout changes in our theme are not applied and the asset paths revert back to the default paths.  The admin panel, similarly is unstyled and unusable.

Interestingly, when I look at the raw source of the page when the site is down, not only do the paths revert back to the default paths, but they are also missing the initial {skin|design|js} path, e.g:

    <link rel="stylesheet" type="text/css" href="/frontend/enterprise/default/css/styles.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/frontend/enterprise/default/css/widgets.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/frontend/enterprise/default/aw_blog/css/style.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/frontend/enterprise/default/css/print.css" media="print" />
   ...
    <script type="text/javascript" src="/mage/cookies.js"></script>

Furthermore, when the site is operating correctly, we have all of our assets minified and served from CloudFront.  At first, I thought this may be the result of a CloudFront hiccup, but I don't think that this is the case.

We're also using Redis for FPC.  Also, I can see the "hole punch" tags in the raw source when loading the page:

<!--{GLOBAL_MESSAGES_aae3749ba9c2e308ffa9c240ac185959}--><!--/{GLOBAL_MESSAGES_aae3749ba9c2e308ffa9c240ac185959}-->

I have temporarily disabled CloudFront and am serving all assets from our server to see if that will address the issue. My next guess would be something with Redis that is causing the problem.  Clearing our Redis cache invariably solves the problem, but it keeps recurring and never at the same time, but about once every day or so

I'm believe this has to do with applying the October 2015 SUPEE-6788 patch.  We did not have this problem prior to applying this patch.

Has anyone experienced something similar or have ideas on how to best debug this problem?  I'm kind of stumped - it's almost as if Magento completely throws out the configuration for this store.

Update 12/8/2015

Over the past couple of weeks, I have disabled Redis for the config cache and have been using file based caching.  This has not fixed the problem.  I also created a little observer to log all cache flushes in an admin file.

Thanks to @Persata and @Luke Rodgers's suggestions below (see comments), I was able to get a stack trace this afternoon - as they noted, it seems to occur shortly (anywhere from a second to 30 minutes) after a full page or block cache flush -- the result is a malformed configuration cache file.  Thanks to Luke's patch that prevents the cache from being saved, it prevented the site from going down.  Here's the trace:

   /includes/src/__default.php(21686): Mage_Core_Model_Cache->save('<admin><design>...', 'config_global_s...', Array, NULL)
#1 /includes/src/__default.php(23473): Mage_Core_Model_App->saveCache('<admin><design>...', 'config_global_s...', Array, NULL)
#2 /includes/src/__default.php(23395): Mage_Core_Model_Config->_saveCache('<admin><design>...', 'config_global_s...', Array, NULL)
#3 /includes/src/__default.php(20960): Mage_Core_Model_Config->saveCache()
#4 /includes/src/__default.php(20882): Mage_Core_Model_App->_initModules()
#5 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /index.php(87): Mage::run('', 'store')
#7 {main}

Unfortunately, I don't have the full output of the configuration that it is attempting to save but will modify my code accordingly. Interestingly, the no issues for over a week (with numerous cache flushes) before getting the trace this afternoon.  Traffic was a little bit higher during this time, but not astronomical.


texts:
How to set Qty Dropdown in minicart in magento2.

If any one knows please explain me?


texts:
I have created a simple module that should add a custom attribute Display Name to customers but when i add this to my site i get no attribute show up. The module is correctly setup and enabled

I've looked in the eav_attribute table in the database and theres no record of it. Cache has been flushed before and after

etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <Namespace_Module>
      <version>0.0.1</version>
    </Namespace_Module>
  </modules>
    <global>
      <resources>
          <module_setup>
            <setup>
              <module>Namespace_Module</module>
              <class>Mage_Eav_Model_Entity_Setup</class>
            </setup>
            <connection>
              <use>default_setup</use>
            </connection>
          </module_setup>
      </resources>
    </global>
</config>

sql/module_setup/mysql4-install-0.0.1.php

<?php
$installer = $this;
$installer->startSetup();
$customerEntityTypeId = $installer->getEntityTypeId('customer');
$atttributeCode = 'display_name';

$installer->removeAttribute($customerEntityTypeId, $atttributeCode );
$installer->addAttribute('customer', $atttributeCode, array(
    'type' => 'varchar',
    'input' => 'text',
    'label' => 'Display Name',
    'global' => true,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'visible_on_front' => true
));

$usedInCustomerAddressForms = array(
    'adminhtml_customer',
    'customer_account_edit'
);
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode);
$attribute->setData('used_in_forms', $usedInCustomerAddressForms);
$attribute->save();
$this->endSetup();


texts: Whenever I had problems with admin Index Management, I just have to go to the CLI/Command and execute the command line to reindex specific or all indexes to fix the issue. This was suggested by the community and wondering why it works on the command line and not in the Magento Admin Index Management.


texts: magento 2 contact us add multiple recipients

texts:
task:

create form "contact us"
send data from the form to 2 Email addresses

I created form but magento 2 does not provide option in admin to add  multiple emails separated by ,

I was looking for a solution to the problem and found a way: completely rewrite the contact form saveing controller and give it your transport method in which you need to assign the number of additional emails

if someone came across such or similar implementation, please help with an example

add


texts:
I have a theme in my package, that handles special products/pages. Therefore I have copy-pasted the file bundle.xml to the folder app>...>layout>my_package>my_theme>bundle.xml and in there I do put (besides other stuff) this:

 <PRODUCT_TYPE_bundle translate="label" module="bundle">
        <label>Catalog Product View (Bundle)</label>
        <reference name="head">
            <action method="addItem"><type>skin_js</type><name>js/bundle.js</name></action>
            <action method="addItem"><type>skin_css</type><name>css/bundle.css</name></action>
        </reference>
</PRODUCT>

And I have 2 problems now with that:

1. The bundle.js-file is taken from the base>default-package (what doesn't bother me any further)
 2.

The bundle-css-file isn't taken at all. Although the file is put into skin>frontend>my_package>my_theme>css>bundle.css

I defined the use of my_theme within the needed pages and it uses all specially changed .phtml-files, but that one here is the only change that is actually done on the skins' folder. Do I need to put something additional on the dashboard or don't I get the point?


texts: Product Import > URLs missing ".htm" extension even after re-indexing.

texts: I am uploading a large number products. The upload runs perfectly but Magento is not adding the file extension to the url_key. So none of the products uploaded have the “.htm” file extension. Even after indexing. I’ve tried everything I can think of to resolve this. I’m using version 1.9.4. This is driving me crazy. I've tried running the import without passing the url_key and the url_path. Magento creates the url with the product name and still no ".htm" extension as configured in the SEO settings.


texts: How can I programatically add shipping address to checkout form

texts:
I'm making a custom shipping module. When a user selects the shipping method, I want it to populate the shipping address fields with some custom address data.

I have overridden the select shipping method handler like so:

var config = {
    map: {
        '*': {
            'Magento_Checkout/js/action/select-shipping-method':
'Vendor_Module/js/action/select-shipping-method'
        }
    }
};

I want to programatically set the form field values on the checkout page. Something like:

define([
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/action/select-shipping-address'
], function (quote, shipping) {
    'use strict';

    return function (shippingMethod) {
        shipping.street("99 Road Street");
        shipping.city("New York");
    };
});

Is there a way to do this without just dumping in the values using jquery?


texts: Change the config value based on dropdown change in magento 2.4.2

texts:
I am using Magento Open Source Edition 2.4.2. I have a custom module where I have an admin configuration like below which is under 'Stores > Custom Menu'.

In the system.xml, I have added the backend model for the 'dropdown field - Import Custom Data' as 'Vendor\Module\Model\Config\Backend\SetTimestamp'
Here is my 'SetTimestamp.php file':
/**
     * @param \Magento\Framework\Model\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $config
     * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
     * @param WriterInterface $configWriter
     * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
     * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\App\Config\ScopeConfigInterface $config,
        \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
        WriterInterface $configWriter,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    ) {
        $this->configWriter = $configWriter;
        parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
    }

    /**
     * Change the Timestamp value to 0 if the Import Customer option gets changed
     *
     * @return $this
     */
    public function afterSave()
    {
        $scope = $this->getData('scope');
        $scopeId = $this->getData('scope_id');

        if ($this->isValueChanged()) {
            $this->configWriter->save(
                self::TIMESTAMP_VALUE_FIELD,
                0,
                $scope,
                $scopeId
            );
        }

        return parent::afterSave();
    }

But, this code doesn't set the value '0' instead it still has the long timestamp value.
Can anyone please help?


texts:
I am building my first Magento store, but I found out that I can't add images to products. It is testing site, so I am learning how things are functioning in Magento.

I tried almost everything - reinstalled flash, shockwave, browsers, updated prototype... No luck.I tried in 5 browsers.

Is there anything elese I can do to try to fix it?


texts: Magento2: Error validating extension in marketplace

texts:
I have developed a module for magento 2. Trying to submit in the marketplace its give the following errors:

Environment: Operating System - Centos 7, PHP Version - 7.0.21, Magento Platform - 2.0.17 CE Varnish, Sampla Data
Command:
vendor/bin/phpunit
Installation issue:
http://magento.dev/gear.html page doesn't contain HIT in cache header.
http://magento.dev/gear/bags.html page doesn't contain HIT in cache header.
http://magento.dev/gear/fitness-equipment.html page doesn't contain HIT in cache header.
http://magento.dev/gear/watches.html page doesn't contain HIT in cache header.
http://magento.dev/home page doesn't contain HIT in cache header.
http://magento.dev/enable-cookies page doesn't contain HIT in cache header.
http://magento.dev/privacy-policy-cookie-restriction-mode page doesn't contain HIT in cache header.
http://magento.dev/about-us page doesn't contain HIT in cache header.
http://magento.dev/customer-service page doesn't contain HIT in cache header.
http://magento.dev/gear/bags/joust-duffle-bag.html page doesn't contain MISS in cache header.   Show less

Environment: Operating System - Centos 7, PHP Version - 7.0.21, Magento Platform - 2.1.11 CE Varnish, Sampla Data
Command:
vendor/bin/phpunit
Installation issue:
http://magento.dev/gear.html page doesn't contain HIT in cache header.
http://magento.dev/gear/bags.html page doesn't contain HIT in cache header.
http://magento.dev/gear/fitness-equipment.html page doesn't contain HIT in cache header.
http://magento.dev/gear/watches.html page doesn't contain HIT in cache header.
http://magento.dev/joust-duffle-bag.html page doesn't contain HIT in cache header.
http://magento.dev/strive-shoulder-pack.html page doesn't contain HIT in cache header.
http://magento.dev/crown-summit-backpack.html page doesn't contain HIT in cache header.
http://magento.dev/wayfarer-messenger-bag.html page doesn't contain HIT in cache header.
http://magento.dev/home page doesn't contain HIT in cache header.
http://magento.dev/enable-cookies page doesn't contain HIT in cache header.
http://magento.dev/privacy-policy-cookie-restriction-mode page doesn't contain HIT in cache header.
http://magento.dev/about-us page doesn't contain HIT in cache header.
http://magento.dev/customer-service page doesn't contain HIT in cache header.
http://magento.dev/joust-duffle-bag.html page doesn't contain HIT in cache header.   Show less


texts:
I have 2 categories with different layout/page design.
However i need the first category (lets call it Artists) to have two different layouts/page design relative to how i went to the category. So, if i clicked at the topmenu Artists it need one layout/page design, and if i clicked at the category list item, artists,  it need another design.

Any suggestions?

I was thinking about using a string in the url like ?specialartistview or ?shopview to define the layout/page design, but don't know if thats possible?

A solution could be just dublicating a category, but that's not what i prefer in this case. I need it as dynamicly as possible :)


texts: How to apply Coupon on the Specific Products in Magento 2?

texts:
I want to apply the coupon on the specific product I tried:

use Magento\SalesRule\Model\Rule;
 public function __construct(
    \Magento\Framework\App\Helper\Context $helpercontext,
    Rule $rule,
 ){
    $this->_rule = $rule;
    parent::__construct($helpercontext);
 }
 public function setCoupon()
{
    // $this->_state->setAreaCode('adminhtml');
    // $this->_state->setAreaCode('frontend');

    $coupon['name'] = 'Offer_asad2';
    $coupon['desc'] = 'Discount for vip signup coupon.';
    $coupon['start'] = date('Y-m-d');
    $coupon['end'] = '';
    $coupon['max_redemptions'] = 1;
    $coupon['discount_type'] ='by_fixed';
    $coupon['discount_amount'] = 15;
    $coupon['flag_is_free_shipping'] = 'no';
    $coupon['redemptions'] = 1;
    $coupon['code'] ='NL04-1234'; //this code will normally be autogenerated but i am hard coding for testing purposes

    $this->_rule->setName($coupon['name'])
            ->setDescription($coupon['desc'])
            ->setFromDate($coupon['start'])
            ->setToDate($coupon['end'])
            ->setUsesPerCustomer($coupon['max_redemptions'])
            ->setCustomerGroupIds(array('0','1','2','3',))
            ->setIsActive(1)
            ->setSimpleAction($coupon['discount_type'])
            ->setDiscountAmount($coupon['discount_amount'])
            ->setDiscountQty(1)
            ->setApplyToShipping($coupon['flag_is_free_shipping'])
            ->setTimesUsed($coupon['redemptions'])
            ->setWebsiteIds(array('1'))
            ->setCouponType(2)
            // ->setProductIds(array(1,2,3))
            // ->setProductIds(array('1','2','3'))
            ->setProductIds(1)
            ->setCouponCode($coupon['code'])
            ->setUsesPerCoupon(NULL);
    $this->_rule->save();
}

Now the issue is this code is applying on every single product->setProductIds(array(1,2,3)) and ->setProductIds(array('1','2','3')) but this is not working for me,
How can I apply the I set the coupon for the specific products?


texts: How to withdraw money from Magento Marketplace

texts:
I sell my extensions on Magento Marketplace.

I had some sales and there are some money in my account.

How do I withdraw it?

Magento is supposed to send it to my paypal but it never does.

I wrote to them but haven't heard from them ever since.

Any of you deal with that kind of problem?

PS: Apparently I am not alone - this guy rants on how terrible Magento Marketplace is to its developers.


texts: How to apply coupon code if specific products are available on the cart?

texts: The cart contains two products ex: product1+product2 then only my discount can be applied, otherwise should not allow even individual also. Based on SKU


texts: How to create a custom e-mail containing an order summary?

texts:
Synopsis

I have been building an abandoned cart e-mail, which is almost working.  I have been struggling with the transaction e-mails and blocks.

I have a table that will be populated with prospects whom abandon their basket which after 7 days will be contacted.  A cron will run every day and send the e-mails.

Observer and E-mail Template

The observer I have:

/**
 * Aggregate abandoned carts and e-mail them.
 *
 * @param Varien_Event_Observer $observer
 * @return void
 */
public function emailAbandonedCartCustomers($observer)
{
    $collection = Mage::getResourceModel('cartabandonment/email_queue_collection')
        ->addFieldToFilter('status', Example_CartAbandonment_Model_Email_Queue::STATUS_PEND);

    foreach ($collection as $customerQuote) {
        $quote = Mage::getModel('sales/quote')->loadByIdWithoutStore(
            $customerQuote->getQuoteEntityId()
        );

        $data = new Varien_Object();
        $data->setData(array(
            'quote' => $quote->getData(),
            //'items' => $quote->getItemsCollection(),
            'items' => $quote->getItemsCollection()->toArray(),
        ));

        //Zend_Debug::dump($data);
        //Zend_Debug::dump(get_class_methods($quote));
        //Zend_Debug::dump($data->getData('items'));

        $emailTemplate = Mage::getModel('core/email_template');

        $emailTemplate->setDesignConfig(array('area' => 'frontend'))
            ->setReplyTo($this->_getHelper()->getSender())
            ->addBcc($this->_getHelper()->getBcc())
            ->sendTransactional(
                $this->_getHelper()->getEmailTemplate(),
                $this->_getHelper()->getSender(),
                $customerQuote->getEmailAddress(),
                null,
                array('data' => $data)
            );

        die('Testing Process');

        if ( ! $emailTemplate->getSentSuccess()) {
            Mage::throwException($this->_getHelper()->__('E-mail was not sent.'));
        }
    }
}

The transaction e-mail has been loaded and configured in the admin console:

Hi {{var quote.customer_firstname}},

You have not completed your purchase, would you like to checkout now?

{{block type='core/template' template='email/example/abandoned_items.phtml' products=$items}}

The contents of email/example/abandoned_items.phtml are:

<? print_r($products) ?>


texts: Get quote item id after product added to cart in observer

texts:
I am working on a custom module where a single product of a certain sku (say fixed-product) will be added to cart multiple times, but with different custom options programmatically. I also need to store it's item_id in another custom table for later use.

I managed to display the different products as separate entities on the cart (instead of just adding the quantity) by rewriting the Codilar\ProfServices\Model\Rewrite\CartItem::representProduct() method to return false if the conditions are met.

But I cannot obtain the item_id of the item once it's added to cart. I tried the following events

checkout_cart_product_add_after and sales_quote_item_set_product

but in the observer when I do $this->getEvent()->getQuoteItem()->getItemId() it always returns NULL

How do I get the item_id of an item added to cart in the observer?


texts: I want to create one dropdown product attribute for the set products image position like "top-right", "top-left", "bottom-left", "bottom-right".


texts: Error with Form Key Validation on logout

texts:
I just enabled form key validation and there's an error showing up on logout:

My Magento version is 1.9.2.2 with last patch 9767 applied

Invalid method Mage_Core_Model_Session::renewFormKey(Array
(
)
)

Trace:
#0 /var/www/magento07/app/code/core/Mage/Customer/Model/Session.php(311): Varien_Object->__call('renewFormKey', Array)
#1 /var/www/magento07/app/code/core/Mage/Customer/Model/Session.php(311): Mage_Core_Model_Session->renewFormKey()
#2 /var/www/magento07/app/code/core/Mage/Customer/Model/Session.php(255): Mage_Customer_Model_Session->_logout()
#3 /var/www/magento07/app/code/core/Mage/Customer/controllers/AccountController.php(236): Mage_Customer_Model_Session->logout()
#4 /var/www/magento07/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Customer_AccountController->logoutAction()
#5 /var/www/magento07/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('logout')
#6 /var/www/magento07/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /var/www/magento07/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#8 /var/www/magento07/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /var/www/magento07/index.php(86): Mage::run('', 'store')
#10 {main}


texts: In magento2,Category Sorting Product list: How to remove position from attributes?

texts:
I have sorted products in categories by:

price (default)
name
position

I need to remove the position from the menu leaving only price and name

I don't want to edit every single category view from the catalog-->manage categories because I have too many categories in the store.

PFA


texts:
Mage: 1.9.2
mysql: 5.6.28
php: 5.6.25

I have local copy of magento 1.9.2 in FAP dir, have database imported and connected via etc/local.xml

In mamp pro-4: added host FAP & pointed directory to FAP dir (magento root).
in core_config_data I have http://fap/ in secure/base_url as well as unsecure/base_url.

When I open host in browser it loads http://fap:8888 however js or css are not loading and when I add /admin to a url I get:

  Not Found The requested URL /admin was not found on this server.

I'm guessing problem is in core_config_data settings, but I've tried pretty much everything.

Any help would be appreciated.


texts: How to can I add some text in invoice pdf magento?

texts:
Image showing lower part of pdf.

I want to change invoice pdf.

I want some text on left side.

And below grand total I want to show line for signiture.

How can I achieve this please help.


texts:
I want to know whether there is any class file available for to know the magento version. If the site has been hacked how to to reveal the version?

I know there's a way as follows.

Mage::getVersion();

But if both the frontend and backend of the magento site is not working, how can we check by going through class files? Which class need to refer?


texts: Can not debug magento 2 use phpstorm with xdebug

texts:
When I try to debug magento2 by phpstorm and xdebug I got this error:

  /opt/lampp/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req
  -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /tmp/ide-phpunit.php --no-configuration
  /opt/lampp/htdocs/magento_sample Testing started at 17:45 ...
  -#!/opt/lampp/bin/php

  PHP Fatal error:  Class
  'Magento\TestFramework\TestCase\WebapiAbstract' not found in
  /opt/lampp/htdocs/magento_sample/dev/tests/api-functional/testsuite/Magento/Bundle/Api/CartItemRepositoryTest.php
  on line 10

PHP Stack trace:

PHP   1. {main}() /tmp/ide-phpunit.php:0

  Fatal error: Class 'Magento\TestFramework\TestCase\WebapiAbstract' not
  found in
  /opt/lampp/htdocs/magento_sample/dev/tests/api-functional/testsuite/Magento/Bundle/Api/CartItemRepositoryTest.php
  on line 10

PHP   2. IDE_PHPUnit_Loader::init() /tmp/ide-phpunit.php:250
Call Stack:

  2.1859     457720   1. {main}() /tmp/ide-phpunit.php:0PHP   3. IDE_PHPUnit_Loader::loadByAutoloader($path = uninitialized)
  /tmp/ide-phpunit.php:173

PHP   4. require_once() /tmp/ide-phpunit.php:246

  2.3308     457720   2. IDE_PHPUnit_Loader::init() /tmp/ide-phpunit.php:250

PHP   5. PHPUnit_TextUI_Command::main($exit = uninitialized) /opt/lampp/bin/phpunit:46

  2.3308     457720   3. IDE_PHPUnit_Loader::loadByAutoloader(???) /tmp/ide-phpunit.php:173

2.3311     460480   4. require_once('/opt/lampp/bin/phpunit') /tmp/ide-phpunit.php:246

PHP   6. PHPUnit_TextUI_Command->run($argv = uninitialized, $exit = uninitialized) /opt/lampp/lib/php/PHPUnit/TextUI/Command.php:126

2.3349     690272   5. PHPUnit_TextUI_Command::main(???) /opt/lampp/bin/phpunit:46

PHP   7. PHPUnit_Runner_BaseTestRunner->getTest($suiteClassName = uninitialized, $suiteClassFile = uninitialized) /opt/lampp/lib/php/PHPUnit/TextUI/Command.php:145

  2.3349     690368   6. PHPUnit_TextUI_Command->run(???, ???) /opt/lampp/lib/php/PHPUnit/TextUI/Command.php:126

PHP   8. PHPUnit_Framework_TestSuite->addTestFiles($filenames = uninitialized) /opt/lampp/lib/php/PHPUnit/Runner/BaseTestRunner.php:96

  2.3385     852992   7. PHPUnit_Runner_BaseTestRunner->getTest(???, ???) /opt/lampp/lib/php/PHPUnit/TextUI/Command.php:145

PHP   9. PHPUnit_Framework_TestSuite->addTestFile($filename = uninitialized, $phptOptions = uninitialized) /opt/lampp/lib/php/PHPUnit/Framework/TestSuite.php:419

  23.8450    2452624   8. PHPUnit_Framework_TestSuite->addTestFiles(???) /opt/lampp/lib/php/PHPUnit/Runner/BaseTestRunner.php:96

PHP  10. PHPUnit_Util_Fileloader::checkAndLoad($filename = uninitialized) /opt/lampp/lib/php/PHPUnit/Framework/TestSuite.php:358

  23.8450    2452624   9. PHPUnit_Framework_TestSuite->addTestFile(???, ???) /opt/lampp/lib/php/PHPUnit/Framework/TestSuite.php:419

PHP  11. PHPUnit_Util_Fileloader::load($filename = uninitialized) /opt/lampp/lib/php/PHPUnit/Util/Fileloader.php:79

PHP  12. include_once() /opt/lampp/lib/php/PHPUnit/Util/Fileloader.php:95

  23.8648    2508240  10. PHPUnit_Util_Fileloader::checkAndLoad(???) /opt/lampp/lib/php/PHPUnit/Framework/TestSuite.php:358

  23.8648    2508400  11. PHPUnit_Util_Fileloader::load(???) /opt/lampp/lib/php/PHPUnit/Util/Fileloader.php:79

  23.8732    2551800  12. include_once('/opt/lampp/htdocs/magento_sample/dev/tests/api-functional/testsuite/Magento/Bundle/Api/CartItemRepositoryTest.php')
  /opt/lampp/lib/php/PHPUnit/Util/Fileloader.php:95

Process finished with exit code 255


texts: Fatal error : Call to a member function getBackendModel() on null in app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php on line 425 M-1

texts: I got error while importing the customer using CSV in the admin.


texts: How to add extension attributes to order interface in magento 2.2

texts:
I wanted to write custom rest api to get all customer's order and details using customer token. I'm able to achieve this by this post.

But it is not loading up my custom extension attribute (Delivery Slot) in the order details api.

Also I need to load the image/thumnail url for each product/item in that order.

Can anyone help me out in this regard?