texts: Load product id from observer model and save to table

texts:
In my observer (for catalog_product_save_after event) i have loaded:

public function execute(EventObserver $observer)
{
    $product = $observer->getEvent()->getProduct();
    $this->productUpdate($product);
    return $this;
}

public function productUpdate($product)
{
    $productId = 1;
    $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
    $currentproduct = $objectManager->create('Vendor\Module\Model\Queue')->loadByProductId($productId);
}

In Vendor\Module\Model\Queue

protected function _construct()
{
    $this->_init('Vendor\Module\Model\ResourceModel\Queue');
}

//Problem here I want to load the product id and save the id to my custom table
public function loadByProductId($productId)
{
    $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
    //$productCollection = $objectManager->create('Vendor\Module\Model\ResourceModel\Queue\CollectionFactory');
     $collection=$this->_productCollectionFactory->create();
                     ->addAttributeToSelect('*')
                    ->load();
    $productid=$collection->getEntity_id();
    return $collection;

}


texts: How to add customSearch component in admin products grid in Magento 2?

texts:
I have to add custom "Search by Keyword" functionality for the products grid in Magento 2. I have to add one text field there for search. when I type it give me search result suggestion.

By default, Magento 2 provide "Search by Keyword" functionality for orders but not for products.


texts:
In my module I need add one column to the eav_attribute_option so created a simple script:

  /* @var $this Mage_Core_Mode_Resource_Setup */
    $this->startSetup();
    $this->run("
    CREATE TABLE eav_attribute_option (
        `show_brand` BOOLEAN,
        );
        ");
    $this->endSetup();

Instantly getting error:

a:5:{i:0;s:332:"Error in file: "/var/www/html/magento/app/code/local/Amber/Checkbox/sql/checkbox_setup/mysql4-upgrade-0.0.0.0.1-0.0.0.0.2.php" - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3";i:1;s:954:"#0 /var/www/html/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')

I'm sorry guys, silly me , ALTER TABLE .


texts: I have override the block Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option but is not working

texts: I have followed this Magento2 - How to override this file Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Options.php  but its now working.


texts: Magento 2.2.3 List all configurable's childs prices when the configurable's childs are out of stock

texts:
For a configurable product, the following code will list the configurable's childs prices only for the childs that are in stock:

if ($_product->getTypeId() == 'configurable') {

    $_children = $_product->getTypeInstance()->getUsedProducts($_product);
    foreach ($_children as $child){
        echo $child->getPrice();
    }

}

When all childs are out of stock, the code above will not show anything.

For a configurable product that has all its childs out of stock, i would need to list the prices of the childs.

Has someone faced the same situation? I'd love to hear about your ideas or contributions.


texts:
In my module, after execution of my script, I need to make a redirect to a page with a query string in the URL.

Here is what I have:

$redirectUrl = 'http://magento.local/en_en/shop/index';
$redirectArgs = array('test' => '1');
$this->_redirect($redirectUrl, $redirectArgs);

I also tried:

Mage::app()->getFrontController()->getResponse()->setRedirect($redirectUrl, $redirectArgs)->sendResponse();

Both methods throw an error: There has been an error processing your request

What I expect is to be redirected to http://magento.local/en_en/shop/index?test=1

Does anyone know how I can achieve that?

Edit:

As suggested, I have tried:

$redirectUrl = 'http://magento.local/en_en/shop/index?test=1';
Mage::app()->getResponse()->setRedirect($redirectUrl);

No error, but nothing happens. I am not in a controller.

Edit 2:

I ended up using:

$redirectUrl = 'http://magento.local/en_en/shop/index?test=1';
Mage::app()->getResponse()->setRedirect($redirectUrl)->sendResponse();

This works as expected! Thank you.


texts: Price not being displayed on Magento 2.2.4 product page

texts:
I have an installation of Magento 2.2.4. I created a new configurable product but the price is not displayed in the frontend nor are the option.

If I create a simple product everything is alright.

Anyone can tell me why?


texts: Magento 2.4.2 How to add Key Features to the product detail page

texts:
I need to add Key Features to the product detail page.The function should be a new attribute, but I don't know how to add it. Do you have a simple and quick way.
Key Features can be replaced with any content.


texts: "Old" price is shown in net, final price is in gross; both should be displayed gross (Magento 2.1.2)

texts:
We are currently experiencing a problem where the "old price" is shown in net (products are configured to have net prices, Magento is configured to display GROSS prices based on eachs product tax), however, the final price is displayed correctly. Also, there is a bug where the correct old price is shown when you select a specific configurable products entity.

Here you can see, that the "Sonderangebots"-Price is 49,90€, which is fine. However, the old price is the configured NET price, which is WRONG. It should show the correctly calculated gross price as well. There has been no modification to the specific template.

This is our backend configuration:

configured to handle net prices, which are configured on product basis

configured to show prices including tax

What do I need to change?


texts: Create a layout file for a module has the same name as magento module but in a different package

texts:
I've been reading a few tutorials, and also a book where they explain how to override, create  and manipulate themes, so far so good, however all of them just address how to create layouts for custom modules with  a different name, here is my situation:

I created a module name "Customer" under a package named "MyCompany" so the path for the code would be :

\app\code\local\MyPackage\Customer

I found a few collision issues that I was able to address with the help of the config.xml file for the module, however I've been unable to determine where should I place my layout and folder for the given theme as

app\design\frontend\MyPackage\default\layout\customer.xml

Is already used by the module that comes with magento, I have not intention of manipulate the core files, I was wondering if there is away to have a different name for the layouts, templates etc or if the only work around would be a name change for my module.


texts: Adding Custom Option For Multiple Products at once . Magento 2

texts:
I have an category of Watches and in this category there is more then 2500 Products now I want to add Custom Option on each Product for that I was following This link so when I write script for it. it was working fine on one product but when I Run the script for the whole category then Custom Option was not added in any single product. While when I Break the loop after only one Iteration then again works for only one product my script is
<?php
use Magento\Framework\App\Bootstrap;

require __DIR__ . '/app/bootstrap.php';

$params = $_SERVER;

$bootstrap = Bootstrap::create(BP, $params);

$obj = $bootstrap->getObjectManager();

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

$category = $obj->get('\Magento\Catalog\Model\CategoryFactory')->create()->load(66);
$optionFactory = $obj->get('\Magento\Catalog\Model\Product\Option');
$productagain = $obj->get('\Magento\Catalog\Model\Product');
$productrepo = $obj->get('\Magento\Catalog\Api\ProductRepositoryInterface');
echo $category->getName();
$catproducts = $category->getProductCollection()->addAttributeToSelect('*');
$inputbox =array(
                "sort_order"    => 1,
                "title"         => "Weist Size (in cm)",
                "price_type"    => "fixed",
                "price"         => "",
                "type"          => "field",
                "is_require"    => 1
            );

foreach ($catproducts as $_product){
    echo $_product->getSku()."
";
    echo $_product->getId()."
";
    echo $_product->getStoreId()."
";
        $option = $optionFactory
                    ->setProductId($_product->getId())
                    ->setStoreId($_product->getStoreId())
                    ->addData($inputbox);
            $option->save();
            echo"Working";
            $_product->addOption($option);
            $productrepo->save($_product);
            //break;
}
?>

In Simple Words When I iterate through products and try to add custom options it fails but the same code works for single product. Thanks


texts: multi-select image switcher for product configuration. how to do?

texts: Tell me how to implement the next task. I have a set product. First, choose the color of the base, then the color of the product edges, and then you need to make it so that the client could choose several options, (like multi-selection) of the goods, or one. The choice should be made by clicking on the image. The problem is that in the standard version of the item you can select only one value. Thanks for the help.


texts:
How to Enable cookies in Magento 2.x?

Where can you configure Cookies in Magento 2.0?


texts: Magento 2: How to add class "paginated" to the body tag if the products are paginated?

texts:
I am working on a Magento 2.1.7 shop and I have created a child-theme of Magento Blank.

I need to add class "paginated" to the body tag if the products category pages display pagination.

I have copied the pager.phtml file to  app/design/frontend/Company/Theme/Magento_Theme/templates/html/, so that I can safely overwrite the defaults.

In this file, there is an if statement that "decides" when the pagination is displayed:

<?php if ($block->getLastPageNum()>1): ?>
 // Pagination code here
<?php endif; ?>

Is there anything I can add inside this if statement that would add class "paginated" to the body tag?


texts: Magento 2: Error updating to 2.1.8 and 2.1.9

texts:
After updating to 2.1.8, and more recently trying 2.1.9, my category pages stopped displaying products.

I started seeing an error when reindexing:

  There is no such adapter: mysql2

I put my dev site into developer mode to get more info. When opening a category page I see the above error and this one as well:

  Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`entity_id` NOT IN ('4336', '4337', '4338', '4341', '4336', '4337', '4338', '43' at line 4, query was:

  INSERT INTO `search_tmp_59c45499257c35_41892677` SELECT `main_select`.`entity_id`, MAX(score) AS `relevance` FROM (SELECT `search_index`.`entity_id`, (((0) + (0)) * 1) AS `score` FROM `catalogsearch_fulltext_scope1` AS `search_index`
   LEFT JOIN `catalog_eav_attribute` AS `cea` ON search_index.attribute_id = cea.attribute_id
   INNER JOIN `catalog_category_product_index` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id
   LEFT JOIN `cataloginventory_stock_status` AS `stock_index` ON search_index.entity_id = stock_index.product_id AND stock_index.website_id = 0 WHERE (stock_index.stock_status = 1) AND (category_ids_index.category_id = 14) AND (`search_index`.`entity_id_filter`.`search_index`.`entity_id` NOT IN ('4336', '4337', '4338', '4341', '4336', '4337', '4338', '4341'))) AS `main_select` GROUP BY `entity_id` ORDER BY `relevance` DESC
   LIMIT 10000

I tried changing the database entries in my core_config_data data table where path is search/engine/engine/ and catalog/search/engine from mysql2 to mysql.

After recompile removed the "no such adapter" error, but the second error is still there. In retrospect, this doesn't seem right because I've since checked the live database of my site and both entries are mysql2.

So I have a few questions with this, but the obvious and most important one is how can I fix this error?

Not as important but I'm also curious what the difference between mysql and mysql2 in the option. How do I know what option to use in the future?


texts: Custom additional custom address attributes not getting saved

texts:
I have created two custom address attribute latitude and longitude in custom address and they are showing fine in backend. However when I am creating a new customer from backend filling some value to these new attributes, they are not getting saved to database.

Anyone please suggest


texts:
Magento 2.

What is the role of the search_query table?
Where is it used?
Should I ever clear it?
What would be the impact of clearing it?


texts: How to customize the font family of shipment packing slip?

texts:
I have already customized the pdf invoice i.e

  PdfInvoice/InvoiceChange/etc/adminhtml/di.xml
  PdfInvoice/InvoiceChange/etc/module.xml
  PdfInvoice/InvoiceChange/Model/Order/Pdf/Invoice.php
  PdfInvoice/InvoiceChange/registration.php

So similarly, I changed pdf shipment packing slip also tried but in the invoice place, I overrode AbstractPdf file but not working please tell me, anyone?

PdfShipment/ShipmentChange/etc/adminhtml/di.xml

 <preference for="Magento\Sales\Model\Order\Pdf\AbstractPdf" type="PdfShipment\ShipmentChange\Model\Order\Pdf\AbstractPdf"/>

PdfShipment/ShipmentChange/etc/module.xml

<module name="PdfShipment_ShipmentChange" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Sales"/>
        </sequence>
    </module>

PdfShipment/ShipmentChange/Model/Order/Pdf/AbstractPdf.php

protected function _setFontBold($object, $size = 7)
    {
        $font = \Zend_Pdf_Font::fontWithPath(
            $this->_rootDirectory->getAbsolutePath('lib/internal/montserrat/Montserrat-Bold.ttf')
        );
        $object->setFont($font, $size);
        return $font;
    }


texts: Magento how to add simple product to shoping cart

texts:
Let say I have a simple product id and I want to add it to shopping cart.
I can add it with

cart->addProduct($product, array('qty'=>1));

But the problem is its  attributes , I want to add them also for example the size and color of the product.


texts: is it possible to override core plugin method by custom preference method?

texts:
is possible to override core plugin method by preference?

Means I need to override afterXyz method in my module by using preference.


texts:
How do I create a product kit (multiple simple products) without any options? If I crate a bundle it gives the user options and it creates an extra step during admin checkout.

Is there anything out there to assemble kits without options?


texts: Get "Add rating" on a custom form. (Magento 1.9)

texts:
I have created a customized popup, on list page for submitting review.
Use of the popup,

When user clicks on write review on list page, it generates a popup with form to submit the review.
Here is my custom form for the popup, I want to add "rating box" in the form.
I tried adding default rating table of "rwd" review/form.phtml but it's not working.

Suggest solution to add rating input:

Write A Review

        <form id="review-form" action="" method="post">
            <?php echo $this->getBlockHtml('formkey'); ?>

                        Title

                            <input type="text" name="title" title="Title" id="summary_field" class="input-text required-entry" value="" />

Click To Rate

                        **I WANT CODE FOR RATING ON THIS TAG**

                    Review

                        <textarea type="text" name="detail" id="review_field" class="input-text  required-entry" value="" title="Review"></textarea>

                <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Submit Review')) ?>" class="button color-border">Submit</button>
                <button type="reset" title="Continue" class="button cancel">Cancel</button>

        </form>


texts: How to make magento 2.2.1 website search results more accurate

texts:
How to make Magento 2.2.1 website search results more accurate?

Now I have developed a new site, it uses the Magento 2.2.1 version, I contact the Magento 2.2.1 version the first time. And I have to search it via google, but couldn't found the result.

So I need to find the help from here? I'm forward to your help, thanks!


texts: Magento 1.9: Fatal error: Class 'FANCourier_Ship_Helper_Data' not found

texts:
Need some help with an error.
I've installed a third party module, it is a shipping module. After I've installed it and I go the shipping methods in the backend, I get this:

  Fatal error: Class 'FANCourier_Ship_Helper_Data' not found in
  app/Mage.php on line 547

My config.xml looks like this:

<?xml version="1.0"?>
<config>
<modules>
    <FANCourier_Ship>
        <version>0.1.0</version>
    </FANCourier_Ship>
</modules>
<frontend>
    <routers>
        <ship>
            <use>standard</use>
            <args>
                <module>FANCourier_Ship</module>
                <frontName>ship</frontName>
            </args>
        </ship>
    </routers>
    <layout>
        <updates>
            <ship>
                <file>ship.xml</file>
            </ship>
        </updates>
    </layout>
</frontend>
<global>
    <models>
        <ship>
            <class>FANCourier_Ship_Model</class>
            <resourceModel>ship_mysql4</resourceModel>
        </ship>
        <ship_mysql4>
            <class>FANCourier_Ship_Model_Mysql4</class>
            <entities>
                <ship>

ship

                </ship>
            </entities>
        </ship_mysql4>
    </models>
    <resources>
        <ship_setup>
            <setup>
                <module>FANCourier_Ship</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </ship_setup>
        <ship_write>
            <connection>
                <use>core_write</use>
            </connection>
        </ship_write>
        <ship_read>
            <connection>
                <use>core_read</use>
            </connection>
        </ship_read>
    </resources>
    <blocks>
        <ship>
            <class>FANCourier_Ship_Block</class>
        </ship>
    </blocks>
    <helpers>
        <ship>
            <class>FANCourier_Ship_Helper</class>
        </ship>
    </helpers>
</global>
<default>
         <carriers>
            <FANCourier>
                <showmethod>1</showmethod>
                <active>1</active>
                <model>ship/carrier_FANCourier</model>
            </FANCourier>
     </carriers>
   </default>

And I also have a Data.php file in the module's Helper folder that looks like this:

class FANCourier_Ship_Helper_Data extends Mage_Core_Helper_Abstract
{

}


texts: Using searchCriteria while searching attributes in magento 2.0

texts:
Fetching attribute info, if I apply multiple filters in a single search criteria, it does not work. But in case of single filter it works perfectly.

Multiple filters HTTP request:

http://192.168.1.180/magento/index.php/rest/V1/products/attributes?searchCriteria[filter_groups][0][filters][0][field]=attribute_code&searchCriteria[filter_groups][0][filters][0][value]=color&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][0][filters][1][field]=attribute_code&searchCriteria[filter_groups][0][filters][1][value]=size&searchCriteria[filter_groups][0][filters][1][condition_type]=eq

Output:
{
  "items": [],
  "search_criteria": {
    "filter_groups": [
      {
        "filters": [
          {
            "field": "attribute_code",
            "value": "size",
            "condition_type": "eq"
          },
          {
            "field": "attribute_code",
            "value": "color",
            "condition_type": "eq"
          }
        ]
      }
    ]
  },
  "total_count": 0
}

But when I hit the single filter one, I get results for both size as well as color.

Single filter:

http://192.168.1.180/magento/index.php/rest/V1/products/attributes?searchCriteria[filter_groups][0][filters][0][field]=attribute_code&searchCriteria[filter_groups][0][filters][0][value]=color&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

UPDATE: Tried the in filter but still no results

{
  "items": [],
  "search_criteria": {
    "filter_groups": [
      {
        "filters": [
          {
            "field": "attribute_code",
            "value": "color,size",
            "condition_type": "in"
          }
        ]
      }
    ]
  },
  "total_count": 0
}

UPDATE 2: Tried "in" in different filters

{
  "items": [],
  "search_criteria": {
    "filter_groups": [
      {
        "filters": [
          {
            "field": "attribute_code",
            "value": "color",
            "condition_type": "in"
          },
          {
            "field": "attribute_code",
            "value": "size",
            "condition_type": "in"
          }
        ]
      }
    ]
  },
  "total_count": 0
}

UPDATE 3: Tried "in" filter in separate filter groups

{
  "items": [],
  "search_criteria": {
    "filter_groups": [
      {
        "filters": [
          {
            "field": "attribute_code",
            "value": "color",
            "condition_type": "in"
          }
        ]
      },
      {
        "filters": [
          {
            "field": "attribute_code",
            "value": "size",
            "condition_type": "in"
          }
        ]
      }
    ]
  },
  "total_count": 0
}


texts: Checkout page issue Internet Explorer in Magento2

texts:
I am using Internet explorer browser, Checkout page is simply loading with loader image.

It is working fine in all other browsers, I am getting below error in console.

Object doesn't support property or method 'find'.

What is the fix for this? Please anyone suggest on this.


texts:
I am getting the below error and i need to find out which class is causing this error.

  PHP Catchable fatal error:  Argument 2 passed to
  Magento\Framework\App\Http::__construct() must be an instance of
  Magento\Framework\Event\Manager, none given, called in
  vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on
  line 93 and defined in vendor/magento/framework/App/Http.php on line
  87

Not sure from where magento2 keeps generating this error. Can anyone tell me from where magento2 generates this error? In that case i can get the desired class from there.


texts:
I have this error in my exception log

  main.WARNING: Subscription for MBI service has been failed. An error occurred during token exchange: {"message":"Handshake request failed."}.

What is causing this? I am on Magento 2.3.1 and PHP 7.


texts: Magento 1 - Rest Api for Child Product List

texts:
I need Child (Simple) Product associated to Parent(Configurable) Product in Rest API
currently i am using below Api .but there is no such data available.
api/rest/products


texts:
I am trying to get controller URL in my Block, but I am not able to get it. I tried this code :

$storeId = $this->_storeManager->getDefaultStoreView()->getStoreId();
$url = $this->_storeManager->getStore($storeId)->getUrl("zipcode/index/index");

This code throws an exception like :

  Undefined property: Tm\Zipcode\Helper\Data::$_storeManager

I can access controller manually at store_name/zipcode/index/index


texts:
I have done M1=>M2 data migration via Magento default tool and now I need for remigrate latest data from M1 to M2. Please let me know how can i do this.

Means, Firstly we have done data migrate from M1 to M2
secondly after some time we have to remigrate latest data from M1 to M2 on same platform.


texts: Additional Image Gallery in Product View

texts: Does anyone know, how to add an additional gallery slider to a product? I want to show a second gallery below the page, to show more images.


texts: HTML5 Uploader by Maven 404 Error in configuration

texts:
I'm trying to install HTML5 Uploader by Maven on stock clean Magento 1.7.0.2 installation, as per
https://www.magentocommerce.com/magento-connect/html5-uploader-by-maven.html

It gets installed, but in admin panel in

System-> Configuration -> MAVENECOMMERCE -> Html5Uploader -> General Settings

I just get 404 error, but it seems to be crucial in order to activate this extension.


texts: Refreshing magento 1.9 cache speeds up checkout significantly

texts:
we have weird issue:
Checkout ttfb after refreshing cache is about 5 seconds

When we leave site going (production mode, visitors visiting) after day we get to loading time up to 20 seconds, when even more we get times more than 40-50s ttfb.
When one cache is refreshed, time of ttfb will reduce back to "normal" .
For now we refresh one cache, that is even disabled to keep loading times bearable. Regular ttfb for cached page (with FPC,ssl) is under 0,3s

Running on VPS with 4x CPU and 4GB ram.

Magento with 4 storeviews 1.9.2.4

Debian with php  5.6.33

+we had tested different checkouts including magento's default, results in same loading times.

Edit: uploaded profiler pics

•product page without cache: https://i.stack.imgur.com/eCiTJ.jpg

•checkout with 12hours old cache https://i.stack.imgur.com/nSEm3.jpg

• checkout with refreshed cache https://i.stack.imgur.com/0zCTP.jpg

Thanks


texts: Track the currency code on product page and checkout page

texts:
I have to display some static block on product-detail-page according to currency selected from currency drop-down. ie If currency code is USD then i want to display text "abc" on product-detail-page and "efg" if currency is different.

Something same need to be done on checkout page.

It can be done by printing array and get that value but i want to do it in proper magento way. How can i achieve this?


texts: How can I get the data when I click the place order button on the checkout page of the magento 2?

texts:
How can I get the data when I click the place order button on the checkout page of the Magento 2?
When clicking button place order, show the output data like var_dump ($data); die (); so as not to redirect to checkout success.
Thank you so much.


texts:
How to move elements from payment to shipment in checkout - magento 2
As you see in the screenshot I need to move the squared part from payment page to shipment and also I need to move some parts from shipment to payment.


texts: Magento 2.2.6 - Cybersource official integration module issue

texts:
I'm facing the following issue with official Cybersource integration module downloaded from the Magento Marketplace.

`PHP Fatal error: Uncaught Error: Call to a member function getStoreId() on null in /vendor/magento/module-quote/Model/Quote/Payment.php:286
Stack trace:
#0 /vendor/magento/module-quote/Model/Quote/Payment.php(180): Magento\Quote\Model\Quote\Payment->getMethodInstance()
#1 /vendor/cybersource/module-secure-acceptance/Controller/Index/PlaceOrder.php(144): Magento\Quote\Model\Quote\Payment->importData(Object(Magento\Framework\DataObject))
#2 /vendor/magento/framework/App/Action/Action.php(107): CyberSource\SecureAcceptance\Controller\Index\PlaceOrder->execute()
#3 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#4 /vendor/magento/framework/Interception/Interceptor.php(138): CyberSource\SecureAcceptance\Co in /vendor/magento/module-quote/Model/Quote/Payment.php on line 286`


texts: Magento contact form not receiving emails

texts:
I am having difficulty making my custom email form receive emails. My success message does not show when the submit button is clicked. I also am getting a Confirm Form Resubmission error when refreshing the page after clicking submit. I am not sure what I am missing to make it work.

Any help would be much appreciate. Here is my php controller function:

public function sendemailAction()
{
    $email = $this->getRequest()->get('email');
    $name = $this->getRequest()->get('name');
    $comment = $this->getRequest()->get('comment');
    $contact = $this->getRequest()->get('support_contact');
    $session = $this->getSession();

    $mail = new Zend_Mail();
    $mail->setBodyText($comment);
    $mail->setFrom($email, $name);

    $mail->setSubject('Vendor Support');

    $mail->addTo($contact . '@example.com');

    try {
        $mail->send();
        $session->addSuccess($this->__('Thank You! We will get in touch with you as soon as possible.'));
    } catch (Exception $ex) {
        Mage::getSingleton('udropship/session')->addError('Unable to send email.');

    }

    $this->_redirect('udropship/vendor');
}

My layout.xml file:

<udropship_vendor_support>
    <update handle="udropship_vendor" />

    <reference name="content">
        <block name="vendor.support" type="itemique_dropship/template" template="unirgy/dropship/vendor/support.phtml"/>
    </reference>
</udropship_vendor_support>

And my support phtml file:

<form id="support-form" class="standalone-form" action="<?php echo $this->getUrl('udropship/vendor/support'); ?>" method="post" enctype="application/x-www-form-urlencoded">

<?php echo $helper->__('How can we help?'); ?>

<fieldset class="form-content">

        Contact department *
        <select id="support_contact" class="select" name="support_contact" required>
            <option value="" disabled selected>--Please Select--</option>
            <option value="billing">Billing Enquiries</option>
            <option value="content">Content Support</option>
            <option value="tech">Technical Support</option>
            <option value="contact">Customer Service</option>
        </select>

        Your issue? *
        <textarea class="textarea" name="comment" id="comment" required></textarea>

</fieldset>

* Required Fields

    <button type="submit" class="btn primary" name="send">
        <?php echo $helper->__('Submit') ?>
    </button>


texts: On using Magento 2 REST API with custom option getting Please specify product\'s required option(s)

texts:
I have working on Magento 2.2 version with REST API on creating a customisation option with a checkbox which is not required.
When i select that checkbox and add to cart that product everything works well but when i not checked that option and want to add to cart that product it gives me an error.
Please specify product's required option(s)
when i checked in magento 2 core it will go in vendor/magento/module-catalog/Model/Product/Option/Type/Select.php that file in public function validateUserValue($values) this function.
Is there any patch aval. for this i have checked some github issue and the patch is aval. for Magento 2.3 but not for 2.2.
Any help is appreciated.


texts: How to override third party module css into custom module

texts:
I am using a third-party module, i did model and template files override, how to override CSS in the custom module.
Under web/css folder i am created three custom less file, how to rewrite from the custom module?


texts: Cannot read property 'push' of undefined

texts:
When pushing an array's contents i get

here is my code


texts: I don´t see Tier Pricing Panel in Magento 2

texts: I added a configurable product in Magento2 but I don't see any panel to add special price and tier price. It mus show in Advance Options but I don't see any Advance Pricing Panel


texts:
I'm working on some report customization and I can see report collections has different behavior on the base of isTotals() parameter.

What is the meaning of isTotals() ?
any relation with the backend report page ( is it a value that can be submitted )?


texts:
I'm new to the magento platform and I am trying my hand at writing my first magento module.

I'm following the guide here: Custom Layouts and Templates with Magento

I've created my module folders and files under app/etc and app/code/local.

I have the following layout code in  in my etc/config.xml file:

    <layout>
        <updates>
            <Company_Modulename_layout module="Company_Modulename">
                <file>myfile.xml</file>
            </Company_Modulename_layout>
        </updates>
    </layout>

This looks for myfile.xml in app/design/frontend/default/default, but this confuses me, shouldn't all my custom module files be independent from the default magento folder structure? Is there a way to organise my layout XML files independently from the app/design/frontend/default folders?

Thanks!


texts: Same bundle item twice with different quantity and price

texts: I have created a bundle product B1 and its price is 15$. In bundle i have included an item P1 which has zero price increase and quantity is 1. Now I want to add P1 again with price increase of 10$ and default quantity of 2. Basically I want to allow users to buy either 1 P1 in 15$ or 2 P1s in 25$ as a bundle. I tried discount but it does not exactly do what i need. So is there a work around to add same product as bundle item in same option OR any other suggestion to do this.


texts: How to skip the payment method step in checkout process in Magento 2.3.2

texts:
I have magento Open Source 2.3.2 setup my client don't want any payment method now. How to remove payment method step in checkout process. I just want to place order without selection payment method.

Any suggestion welcome in advanced.

Below is the exact representation of the requirement.


texts: Homepage Showing a JSON code Instead of Homepage

texts:
We are using M2.3.5-p1
In the last three days the site home page show text as in the attached image.
After cleaning cache it returns.
This is only in home page
We are using Varnish cache and with Amasty layered navigation module.
{"categoryProducts":"","navigation":"","navigationTop":"","breadcrumbs":"","h1":"
\n
\n        \u05d1\u05d9\u05d5-\u05d2\u05d0\u05d9\u05d4<\/span>    <\/h1>\n    <\/div>\n","title":"\u05d7\u05e0\u05d5\u05ea \u05d8\u05d1\u05e2, \u05d1\u05d9\u05ea \u05de\u05e8\u05e7\u05d7\u05ea, \u05d5\u05d9\u05d8\u05de\u05d9\u05e0\u05d9\u05dd, \u05ea\u05e8\u05d5\u05e4\u05d5\u05ea  | \u05d1\u05d9\u05d5-\u05d2\u05d0\u05d9\u05d4","bottomCmsBlock":"","url":"https:\/\/www.biogaya.co.il\/","productsCount":"0","js_init":"","isDisplayModePage":"","currentCategoryId":"0","currency":"","store":"","store_switcher":"","behaviour":"","categoryData":"
<\/div>","cmsPageData":""}

What can cause this issue?

Thank you,
Eran Greenwald


texts: product link type_not_exists when trying to update associated products with api

texts:
I am trying to programmatically update the position value for simple products within a grouped product.  I am trying to use the product_link_api with Mag 1.9.01

$api = Mage::getModel('catalog/product_link_api');
$api->update(...);

The function definition start looks like this:

public function update($type, $productId, $linkedProductId, $data = array(), $identifierType = null)
{...}

Now this seems to be very odd function in that you can specify whether the $productId is the magento id or the SKU by using the $identifierType parameter. However the $linkedProductId seems to want a SKU:

...
    $idBySku = $product->getIdBySku($linkedProductId);
    if ($idBySku) {
        $linkedProductId = $idBySku;
    }
...

Not sure how it know whether it is not but that is by-the-by.  What I am having trouble with is that no matter what I pass in as the $type I get a message like:

Fatal error: Uncaught exception 'Mage_Api_Exception' with message 'type_not_exists' in ......\app\code\core\Mage\Api\Model\Resource\Abstract.php on line 103

I have looked into the catalog_product_link_type table and have:

1 relation
3 super
4 up_sell
5 cross_sell

Looking into the catalog_Product_link  table I have seen that the "associated" products I want to modify are related using link type 3 "super".   However, passing "super" summons the error, passing "3" causes the error.  I have seen that one should pass "grouped" in so I tried that, even thought it made no sense to me given that it wasn't in the link type table.  Failed too.

Any pointers on this? Thanks


texts: Where to set getShowAmounts in pager.phtml?

texts:
In template/page/html/pager.phtml there is the following line which defines whether to show the item count on the product list toolbar:

<?php if($this->getShowAmounts()): ?>

Where is getShowAmounts() set in the backend?


texts:
So, I've been through the documentation on setting up the override structure for SCSS files--which is VERY impressive by the way.  I can manually compile/watch them via terminal/CL just fine.  BUT, what I've noticed is that somewhere, buried, Magento or RWD has a script that is watching the default SCSS folder in RWD and will compile it automatically whenever it sees a change.  BUT, obviously, it doesn't know that my new skin exists and thus does not compile the custom skin.

I've looked through my repo and other source docs and can't find anything about it.

Would anyone know if this is a thing or if something on my host is set to do this?  I wouldn't think SASS files would compile themselves...unless they've become sentient.  But I never considered myself good enough to accidentally write up a Compass-AI.


texts: How to add Order Approve status Before Processing State. I try to add approve state. but after that processing state not changing when i change processing it's still showing approve only ?


texts:
I currently have a theme applied to my magento admin section which I would like to remove and go back to default but I am unsure how to do this.

I'm guessing that it's not simply a case of deleting the theme files and I would like to not break the site.

Can anyone suggest how to safely remove the theme and do back to the default Magento 2 admin?


texts: Send copy of order confirmation email, based on customer data, to different email addresses

texts:
Based on certain customer data I need to send a copy of the confirmation email to other email addresses.

I created an observer to catch the order data

checkout_onepage_controller_success_action

In my observer class I load all data I need with

Mage::getModel('sales/order')->load($observer->getOrderIds());

That works like a charm.

Now some code is selecting the email address where the copy supposed to go to.

But how can I send a copy of the order confirmation email to (always different) email addresses?

$order->sendNewOrderEmail();

Above doesn’t work for me because I need the recipient as a parameter.

Any help will be much appreciated. Thank you.


texts: Magento order-data showing null in sales_order_place_before observer

texts:
I have created a new observer to check the order data passing with "sales_order_place_before" event in observer.My observer is working but when I am trying to fetch the observer event data am getting null values.Please help me resolve this issue.Thanks in advance.
My observer file

    namespace Custom\Order\Observer;

    use Magento\Framework\Event\ObserverInterface;

    class OrderPlacebefore implements ObserverInterface
    {
     protected $_objectManager;

      public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager
      ) {
          $this->_objectManager = $objectManager;
      }

      public function execute(\Magento\Framework\Event\Observer $observer)
      {
        $event = $observer->getEvent();
        $orderObserverData = $observer->getEvent()->getData();
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('mY obsever');
       $logger->info('data' . json_encode($orderObserverData));
      }
    }


texts: Access order details in success.phtml with Magento 2

texts:
Currently trying to add some order tracking to our success page, however we need to be able to access information like the value of the order, the number of items ordered, item SKUs etc.

Are there any simple code snippets to access this information or does it all have to be passed manually?


texts: Why does Mage_Catalog_Block_Widget_Link add ___store query parameter?

texts:
Just reading through the code it appears that this parameter will always appear in the link, I'm not entirely sure why though. I can understand why the value would get appended given hasStoreId returning true, but if no store is specified, the current store is used. Why force a link onto a store it's currently on? Is there a situation in which this actually does something useful?

For context, I was looking into the code because a site we've been asked to review, is using this widget. The existence of this specific query parameter seems to be making Phoenix_VarnishCache generate an EXTERNAL_NO_CACHE cookie which seems to force the client to avoid the cache. The expiration date on this cookie is 3 hours in the future, and the expiration appears to be renewed upon each request. I'm yet to look into why this cookie might function in this manner, it seems odd to say the least. I can't swear that the module hasn't been modified however, so it might not be default behaviour for the module.


texts: How to remove a container from the list of container where a widget can be injected?

texts:
In my custom module layout, I remove some containers that have labels. But they still appear on the back-office list of available containers for widget injection.
For example, in a custom layout, if I use the following directive:
<referenceContainer name="content.aside" remove="true"/>

It effectively removed the container from my layout. But it is still available in the back office for widget injection.


texts:
jquery.min.js:206 Uncaught DOMException: Blocked a frame with origin "https://www.test.com" from accessing a cross-origin frame.

Getting this error. Can anyone help?


texts: Importing Date Attributes in DD/MM/YYYY format

texts:
When importing products with date fields in format dd/mm/YYYY it throws this error:

  Value for 'special_to_date' attribute contains incorrect value in
  row(s): 1, 2, 3

From reading around I see that the date attribute needs to be imported in the following format:

YYYY-mm-dd

however changing the date format in the csv file before importing isn't really an option as Excel doesn't make this easy.

Is there a way to stop this error by programatically modifying the date format before the products are imported?

I assume I need to change something in

 /vendor/magento/module-import-export/Model/Import/

?


texts: Why does magento always change order status to pending after capture method

texts:
I am writing a payment module for our payment gateway,I am a java programmer and new to php,so please forgive for my poor php skill.
I have setted the new order status with pending and payment action with Authorise and Capture in my module.Then I want to change the order status to processing after payment approved in capture method with the code below

        $payment->setStatus(self::STATUS_SUCCESS);
        $order->addStatusToHistory(
            Mage_Sales_Model_Order::STATE_PROCESSING,'payment success',false
        );

But I found that the order status always is changed to pending after the payment like this

How do I fix this bug?please help me,Thank you!

BTW,if I change the new order status with processing,even if the payment failed,the order still will be changed to processing,that's not what I want.


texts: Custom Shipping Method - Execute some code when the admin submit a shipment

texts:
Short Story :

I'm currently working on a custom shipping method and I don't know how to execute some code when the admin submits a shipment.

Long Story :

I'm working on a custom shipping method which uses an external API to check if the client shipping address and products dimension are eligibile for the company transport service. Moreover, this custom shipping method calculates the shipping price based on the distance from the pickup place and the delivery place.

This part is done.

Now, I have to send another API call in order to book the shipping when the admin submit a shipment to an order (of course, I need to do that only when the order uses my custom shipping method). How can I execute some code when the admin hit the button ? I suppose an event can help me but I don't know which one.

Thanks for the help.


texts: How could I create magento 2 code sniffs ruleset.xml or does someone have it?

texts:
We developed a module for Magento 2 and we would like the coding standards to match magento 2 coding standard( no warnings or errors ).

Magento 2 has some additional standards that it runs through once you submit a module, we would like that ruleset.xml
We are already using PSR2.

By the way this slightly breaks the rules of StackExchange, but I think it would be a valuable asset to any M2 extension developer.


texts: Magento 2.1.5 - Sales Order reports show missing data

texts:
I am facing issue with order sales report its skipping some data from monthly order report, Some order dates are missing in reports but in order gird it display with same dates order

  Magento: 2.1.5
  Php: 7.0.27
  OS: Centos

Any one have any idea what is happening with Magento version


texts: How to create MySQL Triggers through setup script

texts:
I placed trigger statement in installer script but it didn't create in MySQL.

Created File here Custom/Module/Setup/UpgradeSchema.php

<?php

namespace Custom\Module\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

class UpgradeSchema implements UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        //Your code for upgrade data base
         $installer = $setup;
        $installer->startSetup();

        $installer->run("CREATE TRIGGER `insert_user_trigger` BEFORE INSERT ON `sitealluser` FOR EACH ROW SET NEW.designs_created_at = NOW();");

        $installer->endSetup();

    }
}

How can I achieve that?


texts:
I have a web call to an ERP system that contains a product's information including its image. All the information that I got from the web call is then stored to its corresponding repository. eg: Call for Product's price goes to MyPriceRepository, call for Product's image goes to MyImageRepository. It's a call to WCF service.

Problem now is that the call for a product's image returns a string that is super long - larger than 65KB. Now, what option do I have to store that string? I see from here: https://github.com/ByteInternet/magento-installer/blob/master/lib/Varien/Db/Ddl/Table.php , we only have option as far as BLOB? How do I use MEDIUMBLOB?


texts: How to add terms and condition checkbox in my custom Checkout step in magento2?

texts: Hello I want to add terms and condition checkbox in my custom Checkout step , i refer the solution in stackexchange but no luck please guide me .


texts: Want to show out of stock associate product of group product

texts: How can I show out of stock associate product of group product.


texts:
So, I'm using Magmi to scan through a database and update inventory for a multi-warehouse Magento setup. This is the pertinent code I'm using:

foreach ($store as $key => $sqty) {
    $sku = odbc_result($rs4, 'sku');
    $qty = odbc_result($rs4, $sqty);
    $updateItem=array("sku"=>$sku, "stock_id"=>$key, "qty"=>$qty);
    $dp->ingest($updateItem);
}

The $store array has 7 entries that indicate the $key and $qty. It runs all 7 times, but only updates the first entry.

I've narrowed it down and it looks like the issue is in the productimport_datapump.php file on line 62:

$item = array_merge($this->_defaultvalues, $item);
$diff = array_diff(array_keys($item), $this->_importcolumns);
if (count($diff) > 0) {

Since the column names are the same, it doesn't import anything past the first entry. Any idea how I can fix this? I've tried brute forcing by restarting the datapump session and starting a new instance on every foreach, but that generates some weird filename errors and obviously isn't best practice.

Thanks!


texts: I want to sort my collection by discount percentage for my sale category, I don't know if it is possible in Magento


texts: Found an error "one or more indexers are invalid. make sure your magento cron job is running."?

texts:
When I run below code in command prompt:

  C:\xampp\php>php C:\xampp\htdocs\magento2\bin\magento indexer:reindex

it is showing as access denied.


texts: Magento 2: Plugin to add data to quote_address table when Place Order clicked

texts:
What method do I need to observe to create a 'before' plugin to add data to the Billing Address data in the quote_address table when a user clicks the 'Place Order' button?

I'd prefer to use a plugin instead of an oberserver, as I've read it's best practice to use plugins where possible (to avoid conflicts with other third-party extending code/observers etc).


texts: Exception - The attribute model is not defined

texts:
I have installed Magento 2.4.1, building a new Magento store - with Luma theme there was no error however the moment I installed Codazone theme the search box at css level is broken and any search submitted is throwing below exception.. search suggestions seems to be working and selecting single product from search doesn't throw any error. Looks like it is error of layered navigation. Advice needed to fix it.
Exception:
1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): The attribute model is not defined.
Exception #0 (Magento\Framework\Exception\LocalizedException): The attribute model is not defined.
#1 Smile\ElasticsuiteCatalog\Block\Navigation\Renderer\Attribute->getJsLayout()
#2 call_user_func_array() called at [vendor/magento/framework/View/TemplateEngine/Php.php:94]
#3 Magento\Framework\View\TemplateEngine\Php->__call() called at [vendor/smile/elasticsuite/src/module-elasticsuite-catalog/view/frontend/templates/layer/filter/attribute.phtml:30]


texts:
I'm making a Magento webshop and I wondered what is best way to implement the following scenario:

Product A is a configurable product which can be fitted with some options and additional related products. This was quite easy to implement, though the thing is that there are fitting costs for product A, which is also quite easy to implement, but the fitting costs are also related to the additional related products that are chosen.

So for instance:

I'm buying product A with fitting costs of 10 euro's. Then I'm adding additional related product B and the fitting costs for that one is 5 euro's. Then the total fitting costs of product A and the additional related product B should be 15 euro's. People can choose to either let the company do the fitting or that the customer itself does the fitting. It the customer wants to do it him/herself there should be no fitting costs.

I've tried some things, but I can't really make it work.


texts:
How to check the third party plugin version without any code in Magento 2?

Also, please let me know what exactly is Setup version and Module version.


texts: trouble setting default alt tag of enlarged product images

texts:
I have been trying to figure out which layer/.phtml/extension is responsible for the empty alt="" in the enlarged images on a site, for example at

https://www.seart.pl/wieszak-polka-vintage-vpk-p-5619.html

The idea is to default to a product or category name when an label is empty.
Being somewhat new, I have poured through guides and followed changes in code from related examples, to no avail. Even after I manually refresh some caches (is that necessary?) and rebuild indexes, an F12 element inspection of the resulting HTML in the browser shows a blank alt= value, which affects web crawlers.

https://github.com/adampmoss/CreareSEO had been installed, but does not enforce

Make "alt" tags mandatory on product gallery images?

(only temporarily  as in this screenshot)

What other files, templates, extensions or settings should I look into?

These two didn't help:

app/design/frontend/base/default/template/catalog/product/view/media.phtml
app/design/frontend/rwd/default/template/catalog/product/view/media.phtml


texts: Getting error looks like we got no XML document in soap apo

texts:
I am trying to use 3rd party soap API , but when I am calling API , I am getting error
"looks like we got no XML document"
My Code is as below
 $options = [
                'UserName' => 'xxxx',
                'Password' => 'xxxx',
                'Email'     => 'xx',
                 'Mobile' => 'xxxx'
            ];

$soapClient = $this->soapClientFactory->create(self::WSDL , ['trace' => $trace]);

       $soapClient->functionName($options));

Please Help


texts:
I'm pretty fresh to Magento and been playing around with Magento 2.2.6 on a MAMP setup.

Can anyone recommend any trustworthy resources for building a theme from the ground up? I am also interested in courses if anyone can recommend any good courses. I checked Udemy but there aren't many Magento courses.


texts:
I reindexed all data successfully with SSH php -f indexer.php reindexall:

Product Attributes index was rebuilt successfully
Product Prices index was rebuilt successfully
Catalog URL Rewrites index was rebuilt successfully
Product Flat Data index was rebuilt successfully
Category Flat Data index was rebuilt successfully
Category Products index was rebuilt successfully
Catalog Search Index index was rebuilt successfully
Stock Status index was rebuilt successfully

But after when i go to Magento admin > System > Index Management all Status are still on Processing, and i can't reindex? In Magento admin the date (Updated at) is Sep 5, 2015.. But if i look in /var/locks/ folder the dates from the lock-files are from today Dec 15, 2015.

Somewhere it's stuck. What do i have to do?


texts: Input fields goes missing in Sales Order Form when there is error

texts:
I am creating a new order from admin panel i.e Sales -> Orders -> Create New Order

After filling the form when i hit submit order it throws error but the input fields in FORM which i already have filled goes missing. I want to keep the input data in input fields but the fields values goes missing.

What i tried but is not working:

<input id="order-billing_address_prefix" name="order[billing_address][prefix]" value="<?php echo isset($_POST["order[billing_address][prefix]"]); ?>" class=" input-text" type="text">

I also tried the following but all in vain:

 <input id="order-billing_address_prefix" name="order[billing_address][prefix]" value="<?php echo $this->getRequest()->getPost('billing_address_prefix'); ?>" class=" input-text" type="text">

and

 <input id="order-billing_address_prefix" name="order[billing_address][prefix]" value="<?php echo $this->getRequest()->getParam('billing_address_prefix'); ?>" class=" input-text" type="text">

Any guide will be helpful!

Note: I am new to magento and apologies if question is not explained well enough!

Thanks


texts:
How to fire query between two variables range?

SELECT * from table where range_from>="0.09" and range_to<="0.09" and id = "158"

This is not giving right result.


texts: Call variable in function from observer excute function

texts:
I create event with observer and execute it . In execute function I get API
respond (PDF file) How can i call this respond from another class ?.Please reply me.


texts:
How can I show last order view on my customer panel dashboard?
by default it shows last orders... I want to show last order view(detail) on dashboard.
finally i tried this code

foreach ($_order->getAllVisibleItems() as $_item) {
     echo $block->escapeHtml($_item->getName());
}

but have a problem, when i have 3 items in one order id it shows like item1 item2 item3. i want to show item1 item2 item3... with image of product. any help?

Now used this code but still cant see all product images, just shows one of them...

<?php foreach ($_order->getAllVisibleItems() as $_item) {
                        echo "Order date: " . $block->formatDate($_order->getCreatedAt());
                        $_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
                        if($childProd = current($_item->getChildrenItems())){
                            $productImage = $_imagehelper->init($childProd->getProduct(), 'category_page_list', array('height' => 156 , 'width'=> 170))->getUrl();
                        }
                        else{
                            $productImage = $_imagehelper->init($_item->getProduct(), 'category_page_list', array('height' => 156 , 'width'=> 170))->getUrl();
                        }

                    }
                    ?>


texts: how to hide a product programmatically on frontend without disabling it, using an event or overriding core classes?

texts:
I'm trying to "hide" a product for a specific country without disabling it from the store.
For now i used two events one is for updating collection on product listing using event (catalog_block_product_list_collection) and the other is before load product page (catalog_product_load_before).

Now it works fine, but the issue is that what if the store owner likes to show the product as featured product on home page or other using a block or else, the above process won't work.

I prefer using event but it doesn't seem to be a reliable solution but before i proceed with overriding core classes, I'd want to be sure that this is the best way.

please guide.
really appreciate your time.

thanks,


texts: display product name through product id in custom tab in magento2

texts:
hello everyone I want to display the product name through product id which is stored in the database through that I want to display the product name in the custom tab in admin grid
screenshot is below


texts: Unable to submit your request Magento Contact Form Error

texts:
I keep getting this error when trying to submit my contact form:
"Unable to submit your request. Please, try again later"

I'm using default Magento contact form.

Does anyone know where to start with this? It was working a few days ago and now it's not.

I've also been having issues with sales emails sending.

Thanks in advance.

In the example below I tried to go to an order and click "send email" then I tired to fill out the contact form on the front end...

# root path of bitnami installation replaced with [root]

2013-08-23T11:06:05+00:00 ERR (3):
exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in [root]/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace:
#0 [root]/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 [root]/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 [root]/app/code/core/Mage/Core/Model/Email/Template.php(454): Zend_Mail->send()
#3 [root]/app/code/core/Mage/Core/Model/Email/Template.php(506): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#4 [root]/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(79): Mage_Core_Model_Email_Template->sendTransactional('sales_email_ord...', 'sales', Array, Array, Array, '1')
#5 [root]/app/code/core/Mage/Sales/Model/Order.php(1321): Mage_Core_Model_Email_Template_Mailer->send()
#6 [root]/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(130): Mage_Sales_Model_Order->sendNewOrderEmail()
#7 [root]/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Sales_OrderController->emailAction()
#8 [root]/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('email')
#9 [root]/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 [root]/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#11 [root]/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#12 [root]/index.php(87): Mage::run('', 'store')
#13 {main}
2013-08-23T11:07:48+00:00 ERR (3):
exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in [root]/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace:
#0 [root]/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 [root]/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 [root]/app/code/core/Mage/Core/Model/Email/Template.php(454): Zend_Mail->send()
#3 [root]/app/code/core/Mage/Core/Model/Email/Template.php(506): Mage_Core_Model_Email_Template->send('christinarule@g...', NULL, Array)
#4 [root]/app/code/core/Mage/Contacts/controllers/IndexController.php(104): Mage_Core_Model_Email_Template->sendTransactional('contacts_email_...', 'custom2', 'example@g...', NULL, Array)
#5 [root]/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Contacts_IndexController->postAction()
#6 [root]/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('post')
#7 [root]/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 [root]/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#9 [root]/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#10 [root]/index.php(87): Mage::run('', 'store')
#11 {main}


texts:
I am trying to install Magento on my localhost server.

I have downloaded magento full version from the http://www.magento.com/download and have got all the files from there running in my project, from here I went to the URL (http://localhost/magento/magento/index.php/install (need the 2x magento as it is a VS project and that's just how they do it for some reason)) and I have got the screen, but from there is it throwing an error in the console saying:

  Uncaught ReferenceError: $ is not defined

I know this is a jQuery error, but for some reason it's not in place. I have added the jQuery libraries in (not sure if it is the right one (<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>)) and this gave me the following error:

  Uncaught TypeError: $(...).setStyle is not a function

This is also the case when using the latest jQuery

Can anyone help me to figure this out/fix this so I can get magento to run please?

Sorry if this seems like a stupid question, I am new to this and would appreciate the help :)


texts:
I am using Magento blank theme, I want to change the layout on Product detail page, on product details page the default layout is 1column layout. How to change from 1column layout to 2columns-left layout. Please help me.
Thanks in Advance.


texts:
I have created a module for custom product tab. It's working fine.

Now the problem is how can rename tab name by admin from admin side. Below is the screenshot.

Below is the code catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View" name="custom.tab" template="Vendor::product/view/details/custom_tab.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Tab One</argument>
                </arguments>
            </block>
            <block class="Magento\Catalog\Block\Product\View" name="custom.tab2" template="Vendor::product/view/details/custom_tab_2.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Tab Two</argument>
                </arguments>
            </block>
            <block class="Magento\Catalog\Block\Product\View" name="custom.tab3" template="Vendor::product/view/details/custom_tab_3.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Tab Three</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

How can we handle this for rename tab name from admin side.


texts: Ajax add to cart button in product detail page magento 2

texts:
I have check online demo of Magento 2 http://magento2-demo.nexcess.net/fusion-backpack.htmlwhen we click on add to cart it add product via AJAX but i have Set up demo on localhost it don't to add Product to cart via AJAX.

Can anyone tell where is settings to enable ajax on add to cart ?


texts: Copy store and website configs to a new store programatically

texts:
I know that I can do this with just using SQL.. but I´m looking to learn new ways here ;)

So the scenario is that I have create a new store and want to copy all core/store and core/website settings.

This is my starting point:

$oldSiteId = 2;
$newSiteId = 3;

/* Get config from old site */
$oldSiteConfig = Mage::getModel('core/config_data')
  ->getCollection()->addFieldToFilter('config_id',$oldSiteId);

/* Save config to new site */
Mage::getModel('core/config')
  ->saveConfig($newSiteId, $oldSiteConfig);

Now this is not working but you get the idea of my approach.. Would love to get some help so I can get it to work!


texts: Layout update: unable to add a child block in layout XML by reference

texts:
I'm having a problem where I can't seem to add a child block in a layout XML file. What am I doing wrong in mylayout.xml that I can't load abc? I have the following files.

onestepcheckout.xml

<onestepcheckout_index_index>
    ...
    <reference name="content">
        <block type="onestepcheckout/checkout" name="onestepcheckout.checkout" template="onestepcheckout/checkout.phtml">
            ...
            <!-- this child block can be loaded -->
             <block type="block/class" template="path/to/template/template.phtml" name="qwe" as="qwe" />
            ...
        </block>
    </reference>
    ...
</onestepcheckout_index_index>

mylayout.xml

<onestepcheckout_index_index>
    <reference name="onestepcheckout.checkout">
        <!-- this child block can not be loaded -->
        <block type="block/class" template="path/to/template/template.phtml" name="abc" as="abc" />
    </reference>
</onestepcheckout_index_index>

checkout.phtml

...
<?php echo $this->getChildHtml('abc') // doesn't work ?>
<?php echo $this->getChildHtml('qwer') // works ?>
...


texts: Magento 2: No such entity with customerId = '' when place an order

texts:
I getting below error when place an order.
Error: No such entity with customerId =

The customer placed an order with their login account but it's not showing customers in error.

This error is throwing from the below file :
/vendor/magento/module-quote/Model/BillingAddressManagement.php

 public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address, $useForShipping = false)
        {
            /** @var \Magento\Quote\Model\Quote $quote */
            $quote = $this->quoteRepository->getActive($cartId);
            $quote->removeAddress($quote->getBillingAddress()->getId());
            $quote->setBillingAddress($address);
            try {
            $quote->setDataChanges(true);
                $this->quoteRepository->save($quote);
            } catch (\Exception $e) {
            /* check log file */
                $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/address-error.log');
                $logger = new \Zend\Log\Logger();
                $logger->addWriter($writer);
                $logger->info('Billing - '.$cartId.' - '.$e->getMessage());
            /* log file over */
                $this->logger->critical($e);
                throw new InputException(__('Unable to save address. Please check input data.'));
            }
            return $quote->getBillingAddress()->getId();
        }

i have added below line for debug log :

$logger->info('Billing - '.$cartId.' - '.$e->getMessage());

so I getting below error while placing an order.

Billing - 8300 - No such entity with customerId =


texts: how to set dafault value for custom field in configurable product with magento 1.9

texts:
i'm working with magento 1.9.0.1.I have a series of products with custom options of type radio. However I cannot set from the setup of the product the default state of that particular option.

I need at least one of the checkboxes (options) to be checked by default as the user enters the product page / adds to cart from category page.

Is this doable from the Magento administration or will it require some extra development (if so how this can be done)?


texts: How to load PHTML file last after page is fully loaded

texts:
I have a script in my phtml file but I want to only load this ones the page is fully loaded.
I am doing a check if my custom module is enabled show the < script >
Adding script like this :
You can achieve this using template call
<referenceContainer name="before.body.end">
        <block class="Magento\Framework\View\Element\Template" template="Namespace_Modulename::before.phtml" name="before_body_js"/>
</referenceContainer>

Can anyone give me a advice or help to figure this out
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>

I have to use this as well
<script type="text/javascript">
  alert("This alert box was called with the onload event");
</script>


texts: How to add attribute manage options image in magento 2.2.7

texts:
I have created the manage option attribute for product attributes. description,image and use_in_guide ina Manage Option section. I able to save the image, description but image data value is not captured in table eav_attribute_option table.

the file name is option.php

protected function _prepareUserDefinedAttributeOptionValues($option, $inputType, $defaultValues)
{
    $optionId = $option->getId();

    $value['checked'] = in_array($optionId, $defaultValues) ? 'checked="checked"' : '';
    $value['intype'] = $inputType;
    $value['id'] = $optionId;
    $value['sort_order'] = $option->getSortOrder();
    $value['description'] = $option->getDescription();
    $value['image'] = $option->getImage();
    $value['filter'] = $option->getUseInGuide();

    foreach ($this->getStores() as $store) {
        $storeId = $store->getId();
        $storeValues = $this->getStoreOptionValues($storeId);
        $value['store' . $storeId] = isset(
            $storeValues[$optionId]
        ) ? $this->escapeHtml(
            $storeValues[$optionId]
        ) : '';
    }

    return [$value];
}


texts:
We have recently upgraded from Magento 2.2.2 to 2.3.2.
And we having an issue in layered filter navigation.

Issue:

When we filter size M for the configurable product (Size M is out of stock).
So behaves correctly and does not show the product(configurable) in listing as per default Magento configuration 'Do not show out of stock product'. Which works correctly.

Now we are filtering next, where we need size M and Color Red product. At that time that out of stock product appears

Expected result: it does not have to appear.

Actual result: It appears still it is out of stock.

What I felt is, when we filter multi attributes. (Size: M, Color:Red) It comes with the wrong result but when filter single attribute (Size: M), It works perfectly.

Any clue why this happens?

Highly appreciated if someone helps out.


texts: Remove Item from Cart using before add product Plugin

texts:
I'm using magento 2.3 and i'm trying to Remove an especifc Item from Cart, using beforAddProduct Plugin.
The problem is that i don't know how to remove the Item from Cart.
It shows the following error: Invalid argument supplied for foreach()

Plugin code:

use Magento\Checkout\Model\Cart;
use Psr\Log\LoggerInterface;

class PreventAddToCart
{
    protected $messageManager;

    public function __construct(
        \Magento\Framework\Message\ManagerInterface $messageManager,
        LoggerInterface $logger
        )
    {
        $this->messageManager = $messageManager;
        $this->logger = $logger;
    }

    public function beforeAddProduct(Cart $subject, $productInfo, $requestInfo = null)
    {
        // $this->messageManager->addWarning("ITEM NÃO DISPONÍVEL");
        // throw new \Magento\Framework\Exception\LocalizedException(__("ha ha"));
        // return [$productInfo,$requestInfo];

        $data = $subject->getData();

        $itemId = $productInfo->getId();
        $subject->removeItem($itemId)->save();

        $items = $subject->getAllItems();

        foreach($items as $item){
            $txt = "\n.SKU --> ".$item->getSku();
            $this->logger->log('DEBUG', $txt);
        }

    }
}


texts: Customers not able to login intermittently

texts:
I am using Magento 1.13.1.0, and getting this issue appearing differently on different browsers.

On Chrome, customers are not able to logged in at all.
On Opera, Customers are able to logged in but redirecting to home page and to links are not updating (from Login to My Account )
On Firefox the issue is not coming, customers are able to login and redirect properly on my account pages.

If anyone has any suggestion on this issue please share.


texts: How can I display non-invoiced items in the invoice?

texts:
I'm facing a kind of stupid problem, but it is a client request.

example:

Some customer orders 5 products (one each) in our shop.
As it is also a wish of our client, that he does not want to use the built in stock-management, we can not assure that all items ordered are in stock or will be available ever (this client sells antique coins).
So when our client creates the invoice, he sets the item quantity of the non-available items to zero (so that they won't get invoiced).

Now our client's requirement comes into play:
He wants the non-invoiced items (qty==zero) to be shown in the invoice too!
The product row should show qty: 0, value=0 and should display a message like "sry, this item is not available anymore".

Do you have any suggestions how I can achieve this?

I've already browsed the core sales module but I can't find the part, where those qty=0 items are kicked out.

Many Thanks
Ingo


texts: How to Get block 'head' description in Magento 2?

texts:
In magento 1.9 i can get the page head description like this in phtml:
$this->getLayout()->getBlock('head')->getDescription()

How can i achieve this in Magento 2 ?


texts: Simplifying configurable products with multiple attributes

texts:
I'm currently setting up an online shop whose main products are lamps.

Lamps are available in different colors/materials. So basically I have a configurable product with several simple products associated for each color/material.

Also, if you buy a lamp, you'll get 2 illuminants for free. There are 4 (or even more) light color types available. These illuminants don't affect the price and are always in stock.

Now, if I would create simple products for each color/illuminant combination, this would be an administrative disaster. I would end up with about 100 simple products for a single configurable product.

My question is, how is it possible to setup the light color attribute dropdown in the product view without actually being associated to a simple product?


texts: Customer Group Invalid login and/or password error

texts:
I've created two customer groups called "Vendor" and "PRO". Users from these two groups should also be able to login from Magento Front End.
My problem is only users from "General" group is able to login. For all others users, I'm getting error like "Invalid login or password". Though my login credentials.


texts: How to change the title from Payment Information to Payment Method in onepage checkout?

texts:
How to change the title PAYMENT INFORMATION to PAYMENT METHOD?

I have changed "Payment Information","Payment Method" in /app/locale/en_US/Mage_Checkout.csv but didn't work.


texts: How to move cross sell products to main (left) column of cart on Magento 1.9

texts: I want to move the cross sell products in 'view cart' (Magento 1.9.1.0) from the bottom of the right column to the bottom (below the cart contents) of the left column. How can I do this?


texts:
How do I? Magento out of stock simple products, but DO want to show configurable product (out of stock)

(We sell T-shirts, in sizes)

Let me explain

we have setting show out of stock products to NO
because layered navigation counted all T-shirt sizes as available (so S would be 10, M would be 10 and L would be 10, instead stock was 6, 8 and 10 resp.) => the solution we received was to set show out of stock products to NO
Now we have a configurable (new) product that has simple products.
We set all the simple products to out of stock (so you cant order)
And set the configurable (new) product to in stock.

The expected behavior would be that we see the configurable (new) product in our store. And when we click on it we cant order it.

The result now is: that the configurable (new) product does not show at all.

Now our question: how do we show the the configurable (new) product (with simple products set to out of stock)

I think there is a discrepancy here with the layered navigation needing us to select 'show out of stock products to no' when this use case would have as set it to 'show out of stock products to yes'

I hope I wrote i down a little bit clear ... hope you understand


texts: How to implement customer specific pricing, Magento 2.3

texts:
We want to display customer specific prices on all product listings and product pages on the front end.

So far what we've done is created a collection plugin for the resource model which fetches a price based on the customers id.

namespace Vendor\Module\Plugin\Catalog\Model\ResourceModel\Product;

// some imports

class CollectionPlugin
{
    protected $_customerSession;
    protected $_customerFactory;
    protected $_productPriceFactory;
    protected $_objectManager;
    protected $_storeManager;

    public function __construct(
        CustomerFactory $customerFactory,
        ProductPriceFactory $productPriceFactory,
        StoreManagerInterface $storeManager,
        Session $customerSession
    ) {
        $this->_customerFactory = $customerFactory;
        $this->_productPriceFactory = $productPriceFactory;
        $this->_customerSession = $customerSession;
        $this->_storeManager = $storeManager;
    }

    public function afterLoad(Collection $subject, $result, $printQuery = false,     $logQuery = false)
    {
        $items = $subject->getData();
        $this->fetchCustomerPrice($items);
        return $result;
    }

    private function fetchCustomerPrice($items) {
        // some code
    }

}

This works fine, however now we are stuck with the problem of caching. The price for the customer who visits a product page first gets shown to everyone.

We've tried following the instructions here: How Magento manages store-wise cache. For our purposes we use customer id instead of zip code. The PageCache Identifier plugin seems to work or at least it's run each time the page loads regardless of caching. Identity plugin does not work as its value gets cached the same way product prices do.

We think that the problem lies with the block and/or model cache, but we are not sure.

How should we continue?


texts: Do I need to select the root category when adding a new product?

texts:
Root category: Root
Sub categories: Sub1, Sub2

When I add a new product for one of the sub categories, should I select also the root one?


texts:
Recently we upgraded Data from Magento 1.9.4 version in to Magento 2.3.2 [we did data migration].

After Data migration, we are facing issue with minicart section. if we click on minicart button it is redirecting to checkout/cart page, instead of showing the minicart items,view/edit cart button, proceed to checkout etc.

I did setup:upgrade, compile, content-deploy, reindex, cache clean, cache flush. Got some information from google, create custom module and over ride cart action. But i am not getting full clarity what i need to do .

There is no issue with order place. Please help me. Thanks in Advance.


texts: Magento 2 : How to use Modal Slide for CRUD Operation using custom module in Admin side?

texts:
I am trying to create a CRUD operation using Modal Slide in Magento 2 Admin Area like below.

Please refer the below screenshot.

I'm spending the last 3 days on this.
Please assist if anybody knows about this.

Thanks in advance


texts: How to show first order review page then payment page in checkout in Magento?

texts: I want to show Order review page first then I want to show payment page in Checkout page in Magento there is any way if then help me...


texts:
I get this error on my product page and only for specific products.

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'handle': Character content other than whitespace is not allowed because the content type is 'element-only'.

The error is because the SKU of the product is added in the layout xml like this:
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><handle id="handle">479259<body>

Here the number 479259 is the SKU and this should not be there. I disabled all my custom modules, even changed my theme to the default Magento theme, changed to production mode, changed my database (the one on production doesn't give this error) but I still get this error. Is there any way to find out where this SKU is coming from?
The error I get in one of the logs is:

Cache file with merged layout: LAYOUT_frontend_STORE1_4e763528242bc7a0eb065e4d209735c84_page_layout_merged and handles default, catalog_product_view, catalog_product_view_type_configurable, catalog_product_view_id_117064, catalog_product_view_sku_479259, pl_thm_customtheme_default, pl_thm_customtheme_default_default, cms_noroute_index, cms_page_view, cms_noroute_index_id_collection, amshopbybase_swiper: Please correct the XML data and try again. Element 'handle': Character content other than whitespace is not allowed because the content type is 'element-only'.

Thank you for the help!


texts:
I am trying to modify the layout of the free iPhone theme that Magento provides for mobile devices.  The majority of the theme will suffice for our purposes but currently the homepage only shows the header and the categories.

I am looking for the best way to add some content (few pictures, text) to the home page on the mobile version only.

What would be the best way to approach this?  Static Blocks?  Would I insert them in the iPhone themes XML layout files?  If so which XML would they go in?

If that is the proper way would this be the correct way to insert?

<block type="cms/block" name="ExampleBlockName"></block>


texts: wrong quantity [zero] is displaying in particular phtml page

texts:
we are using following code for updating quantity in file2.phtml file :

<input type="text" name="qty" id="qty" value="<?php echo intval($mpAssignProductModel->getQty()) ?>" class="required-entry validate-zero-or-greater input-text"/>

i copied this code in file 1, now in file1.phtml page, its displaying like this :

means correct quantity value [20 ] showing in file2.phtml page , but in file1.phtml page, its showing "0" as quantity

full code for file1.phtml, file2.phtml

Edit

for debug, i used this code : <?php var_dump($id); ?> , its displaying NULL


texts: how to add css and js in the footer in magento 2?

texts:
Currently, CSS and JS added in head section default_head_blocks.xml.

But I want to add in the footer. In which I need to put the css and js?


texts: Magento 2 : Add ID or Class to checkout zip code input

texts:
I need to add a ID or Class in the zip code input field on checkout page, but I can't find where this element is rendered.

Any suggestion?

Thank's


texts:
This question has probably been asked a billion times, but I haven't found the exact same issue.

I'm working on a M2 (v2.2.1) shop. Recently I accidentally removed the .htaccess file from pub/static.
I've put it back but since then, not all of my theme's CSS loads. Actually, I'm not even sure if that has caused the issue, or perhaps something else is messed up (too).

I'm using this script to deploy:

rm -Rf pub/static/*
rm -Rf var/view_preprocessed/*
rm -Rf var/cache/*
rm -Rf var/page_cache/*

php bin/magento maintenance:enable
php bin/magento setup:static-content:deploy -f en_US
php bin/magento setup:static-content:deploy -f nl_NL
php bin/magento cache:clean
php bin/magento maintenance:disable

I've tried switching to developer mode, back to production. I've deployed several times, with and without the explicit deletion of static files.

I've run the reindexer, flushed caches. Flushed Redis cache, I've ran the setup upgrade & di compile scripts. I've removed caches & css files from the magento backoffice. I've tried adjusting the app/etc/di.xml file to switch the developerMaterialization strategy from Symlink to Copy. And back.

All of the above in almost every thinkable order.

The CSS file (with correct css code IS included in the page source. The file exists, I can access it via browser or download it via wget from another server, however some of the CSS rules are not applied. When I copy such rules to my browser developer console the rules do take effect, so it's not a matter of a silly css typo or missing file.

I've reverted about a dozen of git commits trying to find any relevant changes, but so far: nothing.

Obviously I lack the knowledge of what is actually happening. At this stage I feel like I'm just making things worse.

Any thoughts?


texts: Add custom jQuery code after checkout page load

texts: I added some jquery code on checkout page but its not working as because the knockout component load after the page load and my jquery code not able to find that element(class or id) on which I have added the jquery code.


texts: clearing caches individually (product, category, homepage, etc)

texts: is it possible to clear things like the products, category, homepage cache individually?  If so, how?


texts:
We've placed our shop behind ssl (https) and I've also secured the contact form (Created a custom module and added <contacts>/contact</contacts> to the <secure_url> section in config.xml). But I can't figure out how to do the same for the review form.

Any tips?


texts:
I would like some ideas for me to handle an output of a helper.

This output I want to manipulate:

Output Html:

.....

Generated by this helper:

$this->helper('yotpo')->showBottomline($this, $_product);

Helper:

public function showBottomline($thisObj, $product = null, $print = true) {

        $res = $this->renderYotpoProductBlock($thisObj, 'yotpo-bottomline', $product);
        if ($print == false) {
            return $res;
        }
    }

I need to do something like this:

$input = $this->helper('yotpo')->showBottomline($this, $_product);
preg_match('....something', $input, $output);
echo $output[1]; //catch a piece of the code generated by helper

Any idea?


texts: email not being sent when customer group is changed via admin

texts:
I know this has been asked before although the code to do this was not so clear and so I have the below code setup however no email is being sent and wondering what step I might of missed. Basically I want to when an admin inside Magento changes a customer to a different customer group and clicks save I then want to send the customer an email.

app/etc/modules/groupidemailnotice.xml

<?xml version="1.0"?>
  <config>
      <modules>
          <groupidemailnotice>
             <codePool>local</codePool>
             <active>true</active>
             <depends>
               <Mage_Catalog />
             </depends>
          </groupidemailnotice>
      </modules>
   </config>

app/code/local/groupidemailnotice/etc/config.xml

<global>
   <events>
      <customer_save_after>
         <observers>
             <groupidemailnotice>
                 <type>singleton</type>
                 <class>magento37890/observer</class>
                 <method>checkDisplay</method>
             </groupidemailnotice>
          </observers>
      </customer_save_after>
   </events>
</global>

app/code/local/groupidemailnotice/Model/Observer.php

    <?php
       class Stackexchange_Magento37890_Model_Observer
          {
            public function checkDisplay(Varien_Event_Observer $observer)
             {

                $customer=$observer->getEvent()->getCustomer();
                Mage::log('My log entry'.$customer->getId(), null, 'Magento37890.log');
                 /* if customer  is old customer */
                 if($customer->getId())
                 {
                     if($customer->getOrigData('group_id')!=$customer->getData('group_id')){
                     /* here you write your code to send whenever you have change the group */
                     mail("$customer->getEmail","approved","Yay your approved");
                     }
                 }else{
                 /* New Customer */

             }
         }

        }

?>

When I look at the system.log I see the below error

  Notice: Undefined index: customer_group_id  in /var/www/magento/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php on line 1780

But why would the observer not be able to get the customer group id??


texts: How to create a custom discount “Gift card” in Magento 1.9 at cart page

texts:
The functionality will be =

Enter Gift Card number(16 digit)
Enter Gift Card Pin(6 digit)
Enter Amount(amount entered by user)

I have already created the above mentioned input fields in the cart page.but dont know how to proceed further.

website: https://www.happyvalleytea.com/

cart page view: https://www.happyvalleytea.com/checkout/cart/ (add any product to cart)

When the user clicks on gift card apply button, the transaction will happen on a 3rd party vendor(via curl api call). The response received from the api should be used as a discount amount on the cart page.


texts: I'm looking module for trace customer gio location with the order. Does any body know module for this?


texts: if has custom product attribute product price change product price

texts: I want To Change product Price using custom attribute.i have custom select attribute .if customer change it I  want  to change product price.


texts:
I am running Magento 1.9.2.1 on a Windows 2008 Server with MySQL. For some odd reason when I go into the Magento Admin area to perform a database backup that seems to work fine until I download and try to unzip it using 7zip. When I do I get an error that says "Data Error in 45943592_db_test File is Broken". Does anyone have any idea why this could be and more importantly how I can fix it?

Frank G.


texts: Magento 2 what happen if a block doesn't define a template path in layout

texts: In Magento 2 ,layout files i see some blocks doesn't specify a template. So which template it will use?


texts:
I am creating a simple custom module for my magento store, just a simple html/js form to select products and list them.
But I can't get the view working.

confix.xml

 <?xml version="1.0"?>
    <config>
        <modules>
            <mymodule>
                <version>1.0.0</version>
            </mymodule>
        </modules>
        <frontend>
            <routers>
                <justlamps>
                    <use>standard</use>
                    <args>
                        <module>mymodule</module>
                        <frontName>formtest</frontName>
                    </args>
                </justlamps>
            </routers>
            <layout>
                <updates>
                    <mymodule>
                        <file>mymodule.xml</file>
                    </mymodule>
                </updates>
            </layout>
        </frontend>
    </config>

app/design/frontend/default/layout/mymodule.xml

<?xml version="1.0" ?>
    <layout version="0.1.0">
    <mymodule_index>
    <reference name="content">
        <block type="core/template" name="mymodule" template="mymodule/view.phtml"></block>
    </reference>
    </mymodule_index>
</layout>

app/design/frontend/default/template/mymodule/view.phtml

test


texts:
I have a custom action which I use to adjust some options for products.  This is done from the cart with an AJAX request.  I'd like to be able to just return the adjusted item's HTML and update that table row.  I can successfully edit the cart item options; however, when rendering that item no options show up in the returned HTML.  If I refresh the page, then the options appear.

Is there any way I can "refresh" or "reload" the quote within the cart and session?  I've tried the following code after I've done my cart edits and before I start the layout rendering.

    $quote = Mage::getModel('sales/quote')->load($cart->getQuote()->getId());

    $cart->getQuote()->collectTotals()->save();
    $this->_getSession()->replaceQuote($quote);
    $cart->setQuote($quote);
    $cart->init();

That does not sufficiently reload the quote so that the Cart block uses the updated quote.

UPDATE: It appears that the only issue is the item options not showing up, not that it's not showing the updated cart.  It's just custom options that are added which aren't showing up.  So the real question seems to be reloading options for quote items.


texts: Can I load all shipping methods automatically on the shopping cart page without selecting a country first?

texts:
Can I load all my shipping methods automatically on the shopping cart page without prior to selecting a country?

By Magento default, you have to select your country where you want to ship your order to. Then you have to hit the button 'Get a quote' for the 'Estimate Shipping and Tax'. But I want to skip this step by showing all my shipping methods automatically as soon as you are on this page.

Is it possible?


texts: Magento 2 - Disable cash on delivery based on cod

texts:
How to  disable cash on delivery payment based on cod availability.
etc/di.xml

<type name="Magento\OfflinePayments\Model\Cashondelivery">
        <plugin name="cashondeliveryplugin" type="Xxx\Yyy\Plugin\Model\Cashondelivery" sortOrder="10" disabled="false" /> </type>

Cashondelivery.php

 public function aroundIsAvailable(\Magento\OfflinePayments\Model\Cashondelivery $subject, callable $proceed)
    {
        $result = $proceed();
        $zipCode = $this->_checkoutSession->getQuote()->getShippingAddress()->getPostcode();
        $codAvailability = $this->_pincodeModel->isCODAvailable($zipCode) ? "yes" : "no";
        if ($codAvailability == 'no') {
            return false;
        }
        return $result;
    }
}

Its not working in backend...Any modification in my code .....


texts: Magento 2 : order email does not have Add extra text field in checkout billing address

texts:
I have used this Plugin to add extra fields in checkout billing address.
https://github.com/sbodak/magento2-checkout-custom-form/
this is adding fields in billing address and in order. But these extra fields are not showing in Order Email received by customer.


texts: Magento 2 : Magic getters for custom attribute, not working

texts:
I have added custom attribute to customer, "authnet_account_number".

It is running, also getting shown on the customer create form in Adminhtml.

But the magic getter for the attribute,$customer->getAuthnetAccountNumber() is not working.

Here is the upgrade schema for the attribute,

 public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var \Magento\Customer\Setup\CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $setup->startSetup();

        /**
         * authnetcim_profile_id customer attribute: Stores CIM profile ID for each customer.
         */
        if ($customerSetup->getAttributeId('customer', 'authnet_account_number') === false) {
            $customerSetup->addAttribute(
                Customer::ENTITY,
                'authnet_account_number',
                [
                    'label'            => 'Authnet account number to be used',
                    'type'             => 'varchar',
                    'input'            => 'text',
                    'default'          => '',
                    'position'         => 70,
                    'visible'          => true,
                    'required'         => false,
                    'system'           => false,
                    'user_defined'     => true,
                    'visible_on_front' => false,
                ]
            );

            $profileIdAttr = $customerSetup->getEavConfig()->getAttribute(
                Customer::ENTITY,
                'authnet_account_number'
            );

            $profileIdAttr->addData([
                'attribute_set_id' => $customerSetup->getDefaultAttributeSetId(Customer::ENTITY),
                'attribute_group_id' => $customerSetup->getDefaultAttributeGroupId(Customer::ENTITY),
                'used_in_forms' => [],
            ]);

            $this->attributeRepository->save($profileIdAttr);
        }
        $setup->endSetup();
    }


texts: How to debug if echo $this->getChildHtml() returns nothing in live

texts:
i'm printing echo $this->getChildHtml('myview'); in product listing page. With the codes below

In catalog.xml

<block type="catalog/product_list" name="product_list"....
     <block type="core/template" name="myview" template="compareview/compareview.phtml" />
</block>

I have build the view file(with just a text content for now) and located on the template path i have mentioned. And this works for me in local but it's blank in live/remove. How can i debug this or where did i go wrong ?


texts: Add customer to multiple customer group magento2.1

texts:
I set group with  eav_attribute group_id to multi-select and set it to varchar. But it doesn't show multi select.
I want to set my customer to multiple customer groups in magento2.1


texts:
I created a file "/app/code/local/Mage/CatalogSearch/Model/Advanced.php" and copied the core file over I'm trying to modify getProductCollection() to get only products with a certain attribute set to 'yes' in the admin.

Here is my code:

$this->_productCollection = Mage::getResourceModel('catalogsearch/advanced_collection')
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addAttributeToSelect('mc_pin_system_avail')
            ->addMinimalPrice()
            ->addStoreFilter();
            Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($this->_productCollection);
            Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($this->_productCollection);
$this->_productCollection->addAttributeToFilter(
                array(
                    array('attribute' => 'mc_pin_system','eq'=> 1),
                    array('attribute' => 'mc_pin_system_avail','eq'=> 1)
                ));

It only returns the values with mc_pin_system_avail set to yes. Can someone tell me what I'm doing wrong??