texts: An error has happened during application run. See exception log for details in Magento 2

texts:
already clear cache.

I found these log in error_log.

  [26-Sep-2019 08:21:49 UTC] PHP Deprecated:  The each() function is
  deprecated. This message will be suppressed on further calls in
  /home/v1net/public_html/devmag/favelady/vendor/colinmollenhour/cache-backend-file/File.php
  on line 81 [26-Sep-2019 08:21:49 UTC] PHP Warning:  "continue"
  targeting switch is equivalent to "break". Did you mean to use
  "continue 2"? in
  /home/v1net/public_html/devmag/favelady/vendor/zendframework/zend-stdlib/src/ArrayObject.php
  on line 426 [26-Sep-2019 08:21:57 UTC] PHP Deprecated:  The each()
  function is deprecated. This message will be suppressed on further
  calls in
  /home/v1net/public_html/devmag/favelady/vendor/colinmollenhour/cache-backend-file/File.php
  on line 81 [26-Sep-2019 08:21:57 UTC] PHP Warning:  "continue"
  targeting switch is equivalent to "break". Did you mean to use
  "continue 2"? in
  /home/v1net/public_html/devmag/favelady/vendor/zendframework/zend-stdlib/src/ArrayObject.php
  on line 426 [26-Sep-2019 08:22:22 UTC] PHP Deprecated:  The each()
  function is deprecated. This message will be suppressed on further
  calls in
  /home/v1net/public_html/devmag/favelady/vendor/colinmollenhour/cache-backend-file/File.php
  on line 81 [26-Sep-2019 08:22:22 UTC] PHP Warning:  "continue"
  targeting switch is equivalent to "break". Did you mean to use
  "continue 2"? in
  /home/v1net/public_html/devmag/favelady/vendor/zendframework/zend-stdlib/src/ArrayObject.php
  on line 426 [26-Sep-2019 08:22:26 UTC] PHP Deprecated:  The each()
  function is deprecated. This message will be suppressed on further
  calls in
  /home/v1net/public_html/devmag/favelady/vendor/colinmollenhour/cache-backend-file/File.php
  on line 81 [26-Sep-2019 08:22:26 UTC] PHP Warning:  "continue"
  targeting switch is equivalent to "break". Did you mean to use
  "continue 2"? in
  /home/v1net/public_html/devmag/favelady/vendor/zendframework/zend-stdlib/src/ArrayObject.php
  on line 426 [26-Sep-2019 08:22:28 UTC] PHP Deprecated:  The each()
  function is deprecated. This message will be suppressed on further
  calls in
  /home/v1net/public_html/devmag/favelady/vendor/colinmollenhour/cache-backend-file/File.php
  on line 81 [26-Sep-2019 08:22:28 UTC] PHP Warning:  "continue"
  targeting switch is equivalent to "break". Did you mean to use
  "continue 2"? in
  /home/v1net/public_html/devmag/favelady/vendor/zendframework/zend-stdlib/src/ArrayObject.php
  on line 426 [26-Sep-2019 08:23:07 UTC] PHP Deprecated:  The each()
  function is deprecated. This message will be suppressed on further
  calls in
  /home/v1net/public_html/devmag/favelady/vendor/colinmollenhour/cache-backend-file/File.php
  on line 81 [26-Sep-2019 08:23:07 UTC] PHP Warning:  "continue"
  targeting switch is equivalent to "break". Did you mean to use
  "continue 2"? in
  /home/v1net/public_html/devmag/favelady/vendor/zendframework/zend-stdlib/src/ArrayObject.php
  on line 426

How can i fix?


texts: Magento 2: Admin Formatting/Rendering problem

texts:
Magento 2.1.9
CentOS 7.0 x64 eaPHP56

Got a very odd issue with admin after a Cpanel upgrade. Frontend works perfectly but the admin has rendering issue. It affects all screens but is worst for anything that's listed in a table. All CSS files load ok, no permission issues.

I've cleared static files, cleaned and flushed cache, redeployed static content with correct languages en_GB en_US, compiled, cleaned local cache, cleared Cloudflare cache but still no joy. I'm at a loss now so anyone who has the faintest idea, please comment :) Thanks


texts:
Can anybody tell me where I can change the title of the invoice pdf.
At the moment it states invoice(date and time). I want to change it to Invoice(invoicenumber)I work with magento 1.9.1.


texts: product collection sorting by price is not working

texts:
I want to sort the product collection by price. For this i am using

->setOrder('price', 'DESC') or ->addAttributeToSort('price', 'DESC') is not working but it is working with ->addAttributeToSort('name','DESC') perfectly.

$_productCollection = Mage::getModel('catalog/product')
    ->getCollection()
    ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('status', 1)
    ->addAttributeToSort('price', 'ASC')
    ->addAttributeToFilter('visibility', 4)
    ->addAttributeToFilter('category_id', array('in' => $categoryIds));


texts: Get price without currency symbol on one page

texts:
I want to load the price without the currency symbol on one single page.
I load the price currently with this code:

<?php echo $this->getPriceHtml($_product, true) ?>

Thanks!


texts:
I have enabled terms and conditions in the backend to show the terms and condition content on the checkout page.

I want to show the terms and condition content in a pop-up.

ie, if "I agree to the terms of use" is the checkbox text added in the backend. On clicking "terms of use", I want to show the terms and condition content in a pop-up.

I want to show the terms and condition content in a pop up for my checkout page.

I have enabled terms and conditions in the backend to show the terms and condition content on the checkout page. But instead of showing it as a plain text(above the checkbox text), I want to show the content in a popup.

Here is my code:
app/design/frontend/theme/default/template/checkout/onepage/agreements.phtml

<?php if (!$this->getAgreements()) return; ?>
<form action="" id="checkout-agreements" onsubmit="return false;">

<?php foreach ($this->getAgreements() as $_a): ?>

        <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
            <?php if ($_a->getIsHtml()):?>
                <?php echo $_a->getContent() ?>
            <?php else:?>
                <?php echo nl2br($this->escapeHtml($_a->getContent())) ?>
            <?php endif; ?>

        <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" />
        <label for="agreement-<?php echo $_a->getId()?>" onclick="termspopup()"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?>

<?php endforeach ?>

</form>

I have called a function in onclick of a label onclick="termspopup()" and tried to enable the fancybox in the function. But on clicking the checkbox content getting error in console as ReferenceError: termspopup is not defined

How can I solve this issue? Please help..


texts: Magento2 How to create custom module which will be install in Vendor folder using composer

texts: I have created an extension now I want to install this using composer command in the vendor folder.


texts: I have the problem that I can not upload my images to the product pages. It was working before, but now it is not possible. I have tried to upload with different browsers(Firefox/Explorer/Chrome), they all have the same problem. The buttons (browse / upload) appaer and I can select my image and upload it.(It shows that it is charching.) But it does not appaer in the list of product images. I asked a friend to try to upload. With his computer it was possible to upload the images to the list.What kind of problem am I facing here? Has it to do directly with magento? Thanks for the help.


texts: Is it possible to create plugin on non magento module? for example for webonyx/graphql-php


texts: Show /Hide my custom payment method - (offline) at checkout in magento 2

texts:
I need to hide custom offline payment method according to customer Groups! how to achieve this
?


texts:
Because of business logic I need to round all product prices to the nearest thousand.

Example:

If i have a price of $18600 i need to change the price to $19000. If i have $18400 i need to change it to $18000.

I've played with setDisplayValue($value) and getDisplayValue() methods from Magento_Framework/Pricing/Render/Amount.php but this does not change the price in all the store.

What file(s) should i modify to affect the behavior in all the store?

Thanks,

A. Martz.


texts: Magento use categories path for product URLs on search result page for SEO

texts:
We currently have Magento setup to "use categories path for product URLs", this ensures the category url key is applied in-between the domain and product key.

Working correct URL

http://domain.com/category/product.html

It works perfectly however when you search for products using the "quick search" the product links on the resulting page do not have the category key in them and hence the product links do not work?

Not working incorrect URL search page

http://domain.com/product.html

How can I change the quick search result page to use the categories path in the product URLs?


texts: Magento 2 Shipping Method fail to load due the http 500 error

texts:
The shipping method failed to load after I complete setup the payment method and so on... None of the method shown in the frontend and a error log shown as below

http://domain/Magento2/rest/default/V1/guest-carts/o5DzNV7FmLFXLua4B2OusRbkHRJcIpfc/estimate-shipping-methods

The inspect show Failed to load resource: the server responded with a status of 500 (Internal Server Error)

can someone help me to solve this problem....


texts: Magento2 custom filter not showing in frontend

texts:
I have added an attribute size as dropdown.
sizes are for example

24 * 24, 24 * 32

I have two products.

product1 -24 * 24

product2 - 24 * 32

storefront properties set as
use in search - yes

visible in advanced search - No

comparable in frontend - No

Use in Layered navigation -filterable (with results) also tried (with no results)

Use in Search result navigation - yes

visible on catalog pages on storefront - yes.

used for sorting in product listing - no

Filters for other attributes are showing fine.

am I missing something?


texts: How can I change reply-to email adress of contact form when using transactional email template?

texts:
I am using a custom template for the contact form because I need a unique subject line for incoming contact form. I got that working by using a custom transactional email template. But now I came across a new problem: the reply-to email is set to an email address of our store instead of the person who filled in the form.

How can I use the customer's email address as the reply-to address?


texts: Magento 2 : How to watermark pdf of a downloadable product?

texts:
Suppose a downloadable product has pdf uploaded as link and samples. How can i watermark that pdf in magento 2.1 with dynamic data like customer name . So , when user downloads it after order approval, he/she should get the watermarked pdf.

I have got customer name from session in \Vendor\Module\Controller\Download\Link which overrides Magento\Downloadable\Controller\Download\Link which is responsible for downloading the file.

Help me out peeps.


texts: Undefined class constant 'PDO::MYSQL_ATTR_SSL_KEY' in/magento/setup/src/Magento/Setup/Model/ConfigOptionsList.php:179 in magento localhost

texts:
Ater execute any command getting this error

  Operating system :- Mint ubuntu

  Php version  :- 7.2

  Magento :- 2.3.4


texts: Images in the Admin But All are Selected as "No Image"

texts: We are coming across a weird issue with one of our websites. We have all of the images uploaded into the admin and we see them when we are in manage products, on the images tab. BUT all of the images are selected as "No Image" instead of "Base Image" "Thumbnail" "Small Image". How can I fix this? Can I do this in an import? If so could you please show an example import sheet.


texts:
How to download text file from button on click . I created Button in my system.xml i define frontend Model i want to download text file when i click on button .below is the code i am using

              <test_request translate="label">
                    <label></label>
                    <frontend_type>button</frontend_type>
                    <frontend_model>module/system_config_form_test</frontend_model>
                    <sort_order>17</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>0</show_in_website>
                    <show_in_store>0</show_in_store>
                </test_request>

test.php

  public function getButtonHtml()
    {
        $button = $this->getLayout()->createBlock('adminhtml/widget_button')
            ->setData(array(
                'id'        => 'kems_export',
                'label'     => $this->helper('adminhtml')->__('Export License Request'),
                'onclick'   => 'javascript:exportTest(); return false;'
            ));

        return $button->toHtml();
    }

Thanks in advance


texts: How can I add UNIQUE Constraint in table via 'InstallSchema'?

texts:
I know the syntax to create table via InstallSchema in  Magento 2, but I don't know how to add a UNIQUE Constraint on two columns of my table.

Here is the syntax of my table  -

$table_mediatype = $setup->getConnection()->newTable($setup->getTable('mediatype'));
$table_mediatype->addColumn(
    'id',
    \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
    null,
    array('identity' => true,'nullable' => false,'primary' => true),
    'Entity ID'
);
$table_mediatype->addColumn(
    'mediadownloader_id',
    \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
    null,
    array('nullable' => false),
    'Mediadownloader ID'
);
$table_mediatype->addColumn(
    'product_id',
    \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
    null,
    array('nullable' => false),
    'Product ID'
);
$table_mediatype->addColumn(
    'media_type',
    \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    25,
    array('nullable' => false),
    'Associated Media Type'
);

Via an SQL query we can add a UNIQUE Constraint like this  -

ALTER TABLE netzwelt_mediatype
ADD CONSTRAINT unique_product_id_with_media_type UNIQUE unique_product_id_with_media_type(
    `product_id` ,
    `media_type`
);

But I don't know how to add it via 'InstallSchema'. Can anyone help me in this?


texts:
I would like to add the last pics from my instagram in my Magento Frontend.

I've seen the IG API and there is an Endpoint for this requeriment.

Searching the web I've found examples of the call with PHP (https://gist.github.com/cosenary/2961185)

It should be pretty easy to implement in a static website but I do not have idea on how to implement in on my magento to show in my CMS, should I create a widget? There is no way to develop it in an easy way?

Thanks in advance.


texts: How can i add custom link for "Advanced Search" if return no results

texts:
I need to add custom link in Advanced Search. If no products return, my link will be shown.

workout : i am added to the link in advanced search coding page,but it's remain also products results, my need no products then will shown my link.

How can i do that.


texts:
I have a product with a very weird SKU (which is valid in Magento 2.3.2):

Although, REST API requires using SKU as a part of URL to get the stock item info.
How is it possible to use that SKU as a part of URL? If I don't encode it, it is, obviously, invalid URL. If I encode it, I'm getting an error:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>404 Not Found</title>

Not Found

The requested URL was not found on this server.


texts: Charging credit card via Magento admin new order using Authorize.Net

texts:
Some of our customers provide their credit card information via phone or email to buy merchandises. Items are expensive and the way to avoid fraud transactions, we use Signifyd.com to protect our sales.

We have Virtual Terminals to charge customers but by this way, they will not check for any fraud possibilities. (We are using Athorized.net as the merchant account) By adding a new order in Magento admin panel, we have an option to fill the credit card information in payment section.

After entering credit card information, it gets error while saving the order (Gateway error: This transaction cannot be accepted)This error is generated when your Authorize.Net account is in Password-Required Mode and you are not sending a valid Transaction Key.

Is there any way to charge the card through admin panel by making a new order? .


texts:
I need to create a table in page product.

Now my code work well but, in some products, there is white space in table.

My code:

<?php if($_additional = $this->getAdditionalData()): ?>

<?php echo $this->__('Additional Information') ?>

    <col width="25%" />
    <col />

    <?php $_totale=count($_additional); $_contatore=0; ?>
    <?php foreach ($_additional as $_data): ?>
                <?php if (!strpos(($_data['code']),"filtro")) { ?>
        <?php if ($_data['value']!="No" ): ?>
            <?php if ($_contatore%2==0): ?>

            <?php endif; ?>

                    <?php echo $this->htmlEscape($this->__($_data['label'])) ?>

                    <?php #echo ">>".$_data['code']."<<"; ?>
                    <?php echo $_data['value']; ?>

            <?php if ($_contatore%2==1): ?>

            <?php endif; ?>
        <?php endif; ?>
        <?php $_contatore++; ?>
                <?php } ?>
    <?php endforeach; ?>

If use the "modulo" operation.

can you help me?


texts: Issues with addAttributeToFilter category collection

texts:
I added a new attribute "featured_category" as a boolean.

The issue I'm having is when filtering on a category collection - it seemingly ignores this value in my filtering:

/** @var $categories Mage_Catalog_Model_Resource_Category_Collection */
$categories = Mage::getResourceModel("catalog/category_collection");
$categories->addAttributeToSelect(array("name", "image"))
           ->addAttributeToFilter('is_active', array('eq'=>'1'))
           ->addAttributeToFilter("featured_category", array("eq", '1'));

I originally thought it was a string/integer/boolean type thing, but '1', 1 and "1" all fail to filter the collection.

I'm sure this is going to be something obvious...

-- including mysql4-install-0.2.0.php in case it has some impact...

$installer = $this;
$installer->startSetup();

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$entityTypeId     = $setup->getEntityTypeId('catalog_product');
$attributeSetId   = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$setup->addAttribute('catalog_category', 'featured_category', array(
    'type' => 'int',
    'group'     => 'General Information',
    'backend' => '',
    'frontend' => '',
    'label' => 'Featured Category (Home Page)',
    'input' => 'select',
    'class' => '',
    'source' => 'eav/entity_attribute_source_boolean',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => false,
    'default' => '0',
    'searchable' => false,
    'filterable' => false,
    'comparable' => false,
    'visible_on_front' => false,
    'unique' => false,
));

$setup->addAttributeToGroup(
    $entityTypeId,
    $attributeSetId,
    $attributeGroupId,
    'featured_category',
    '13'//last Magento's attribute position in General tab is 10
);

$installer->endSetup();


texts: Magento 1.9.3.4 check events fired by custom modules and time it takes to perform

texts:
In my magento site there are 40 + custom extensions.  Page speed extremly slow did everything to optimize the frontend but no progress so i want to track all the events fire by extensions.

I tried to log the Events by writing  Mage::log($name,'event.log',null) in Mage.php file which logs all the magento's events  not the events fired by custom module.

How can i check  which events are being fired by custom module and How much time it takes to load.

if i want to optimize it code level then what else do i need to check?

Any help would be appreciated.


texts: How To Pass A Custom Price Value To Product List Price Renderer In Magento 2?

texts:
We have come across an issue that I'm trying to solve. In order to overcome this bug https://github.com/magento/magento2/issues/10009 where discounted prices are not applied per customer group, I've created a module that will handle this. I have set up a database table which looks like this:

And I need to render the price on the product list and product view page. I want to use the built in price renderer but I am unable to figure out how to do this. Currently my code looks like this:

public function getCustomerGroupSpecialPrice($productId)
{

    $collection = $this->customerGroupPricesCollectionFactory->create();
    $collection->getSelect();
    $collection->addFieldToFilter('product_id', array('eq' => $productId))
                       ->addFieldToFilter('customer_group_id', array('eq' => $this->getCustomerGroupId()));
    foreach ($collection as $item) {
        $price = $item->getData('price');
    }
    return $price;
}

This does get the correct price but it looks like this:

and what I need is for the price to be rendered like this:

I've tried overriding the price like this:

class CustomerGroupSpecialPrice extends AbstractPrice
{
    /**
     * Price type identifier string
     */
    const PRICE_CODE = 'customer_group_special_price';

    protected $customerGroupPricesCollectionFactory;

    public function __construct(
        \Icansee\CustomerGroupsPrices\Model\ResourceModel\CustomerGroup\CollectionFactory $customerGroupPricesCollectionFactory
    ) {
        $this->customerGroupPricesCollectionFactory = $customerGroupPricesCollectionFactory;
    }
    /**
     * Get Base Price Value
     *
     * @return float|bool
     */
    public function getValue()
    {
        if ($this->value === null) {
            $this->value = false;
            $collection = $this->customerGroupPricesCollectionFactory->create();
            $collection->getSelect();
            $collection->addFieldToFilter('product_id', array('eq' => $productId))
                               ->addFieldToFilter('customer_group_id', array('eq' => $this->getCustomerGroupId()));
            foreach ($collection as $item) {
                $price = $item->getData('price');
            }
            $this->value = $price;
        }
        return $this->value;
    }
}

but I get an error of class not found as the PRICE_CODE 'customer_group_special_price' does not exist within Magento and so I can't do it this way. I don't really want to code in the HTML into the template to render the price correctly, as we need to render this price in multiple places, such as a quickview modal popup, product view etc. so I would need to hard code this in multiple places and that won't do. How can I render the price value correctly from my custom table?


texts:
I am trying to translate a string by using translate.csv located in theme but translation is not working.

Here is my string

"To check your Gift card information, please click here.","klik her for at tjekke din gavekortskode."


texts: Magento2.1.9 In checkout page ship here than getting error

texts:
I am using magento2.1.9 when login after goes to checkout page then click ship here button after getting an error in console network and fronted side this error comes first time after change ship here address than error not coming.so if anyone idea replies to me.

{message: "Carrier with such method not found: %1, %2", parameters: ["matrixrate", "matrixrate_57415"],…}
message: "Carrier with such method not found: %1, %2"
parameters: ["matrixrate", "matrixrate_57415"]
trace: "#0 [internal function]: Magento\Checkout\Model\ShippingInformationManagement->saveAddressInformation(18678, Object(Magento\Checkout\Model\ShippingInformation))↵#1 /home/apps2/public_html/vendor/magento/module-webapi/Controller/Rest.php(307): call_user_func_array(Array, Array)↵#2 /home/apps2/public_html/vendor/magento/module-webapi/Controller/Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()↵#3 /home/apps2/public_html/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))↵#4 /home/apps2/public_html/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))↵#5 /home/apps2/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()↵#6 /home/apps2/public_html/index.php(40): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))↵#7 {main}"


texts: How to display only subcategories in layered navigation?

texts:
Layered Navigation shows all categories. I have the category structure as below:

-Default Category(8)
    -Flowers(5)
       Rose(2)
       Lotus(3)
    -Fruits(3)
       Apple(2)
       Orange(0)
       Grapes(1)

If I click the category Fruits from the main navigation all categories are displayed in layered navigation. Like this:

   Flowers
   Rose
   Lotus
   Fruits
   Apple
   Orange
   Grapes

But I need to display only the subcategories of the selected category (here Fruits) in layered navigation. Expected result is:

Apple
Orange
Grapes

How can I do this?

To display layered navigation what I did is: In Catalog > Manage Categories >  (Category name) > Display settings change Is Anchor to Yes.


texts: Magento2 Object Manager Issue in MTF test run windows

texts:
I am learning on how to use MTF in my test module. I am trying to run generator using command

php generate.php

But I am getting following error -

Uncaught Error: Class 'Magento\Mtf\ObjectManagerFactory' not found

I am following the following link

https://devdocs.magento.com/guides/v2.0/mtf/mtf_quickstart/mtf_quickstart_environment.html

Also there was an error which was coming before due to line in bootstrap.php-

require __DIR__ . '/../vendor/autoload.php';

So I gave path to autoload.php assuming it was path to the autoload.php located in vendor folder


texts: Before_Body_End Catalog Pages Only Layout.xml

texts: I'm looking to put a tracking script on all Catalog pages. Search Pages, Category (Layered & Non) and Product_View. Is there anyway to do this with Layout.xml? The best place for a script is Before_Body_End but I can only seem to access that from <Default/> which then does all the pages. Outside that, I can get it in the pages I mentioned but only before the footer starts.


texts: Prevent "New Order" Notification Checkboxes from Being Re-Checked Automatically

texts:
I've edited the adminhtml template for these checkboxes (totals.phtml) and successfully removed the "checked" attribute that causes them to be checked by default. Now, when the New Order page first loads for the admin, these boxes are checked. However, as soon as I perform an action on the page (such as adding a product to the order), the boxes become rechecked automatically. How can I prevent this behavior?

The problem ended up being that certain actions (like adding products) would reload the page using the core /vendor template file vs. my module's


texts:
Im currently trying to get some kind of rich snippets onto my cms blocks. For displaying the rich snippet I would like to add a block. This block needs to be able to receive some data from the current site.
Im currently using this on the cms pages:
{{block type="core/template" name="my-template" template="path/to/template.phtml"}}

Can I give some kind of data to this template? Something like
{{block type="core/template" name="my-template" template="path/to/your/template.phtml?data=value"}}

Is this possible this way or is there any other way to do this properly?

Another idea would be using the name of the block. How do I get the name of the block inside of the block?


texts: How to add bread crumbs in "1 Column Page" (Magento 1.9)

texts: How I can add bread crumbs in the 1column.phtml file?


texts: How to add dropdown attribute to custom module in magento 2.0

texts: I wanted to add dropdown attribute called 'customer type' with drop down options 'buyer' and 'seller' to my custom module. How can I make it to my upgrade schema?


texts:
i want to retrieve a base url and append it with my module controller link from .js file, so it's impossible to use block to get the base url. so far i've done this:

define([
   'jquery',
   'mage/url'
], function ($,url) {

  var linkUrl = url.build('namespace_module/regions/index');
  console.log(linkUrl);
});

but i only got this result:

  namespace_module/regions/index


texts: Magento 2.3.3 - Image URLs are getting double slashes added

texts:
wondering if anyone might be able to point me in the right direction, magento is generating image urls with two slashes for me, for example promobanners//m/o/modern.jpg or //.thumbswysiwyg/social/pinterest.png
I know I should provide more info or what I've tried but I'm honestly lost on this one, I don't really have much more detail. This is a issue because I migrated the media folder over to AWS S3, the double slashes did not affect a regular server, but it break with S3.
Any suggestions on what to troubleshoot are welcome


texts: Magento 2: How to filter orders by order items

texts:
In magento 1, I was able to filter orders by the following:

$orderitem = Mage::getModel('sales/order_item')->getCollection();
$orderitem->addFieldToFilter('name',array('like'=>'%'.$value.'%'));
$ids =array();
foreach($orderitem as $item){
  $ids[] = $item->getOrderId(); //  sales_flat_order_item.order_id = sales_flat_order.entity_id
}
$this->getCollection()->addFieldToFilter("entity_id",array("in",$ids));
return $this;

How would I achieve this in Magento 2.3?


texts: How to include Welcome msg in header.phtml - Magento 2.0

texts:
I need to include a welcome message in a custom place of my header.phtml file. In Magento 1.9 I could do it with

<?php echo $this->getChildHtml('welcome') ?>

How to do the same in 2.0?


texts: Thumbnail role missing in product edit page admin

texts:
Update : Now Upgraded to 2.2.2 before it was 2.1.2

ISSUE

I am trying to figure out why thumbnail role suddenly missing when i try to edit a product from admin and want to change thumbnail image also for new products thumbnail role not showing please see attached image

Steps:

From Magento 2 admin go to products->catalog try to edit any product
Click Images and Videos Tab
Select any image which i want to assign as thumbnail image a popup appears with roles but thumbnail role is not here also same happens for add new product see attached image for details.

please advance thanks for help.


texts: Get upload_dir for custom system configuration file upload || getFieldConfig for custom system configuration

texts:
Im trying to add a file_upload to my custom module system configuration.

The backend part works flawlessly and im able to upload the files to the directory i want them to.
But i cant read the file where i want to use it, because if i try to get the configuration value, i only get the part of the path after the actual upload directory.

My system.xml looks like this

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="id" translate="label" sortOrder="1000">
            label
        </tab>

            label
            <tab>tab</tab>
            <resource>Vendor_Module::label</resource>
            <group id="id" translate="label" type="text" sortOrder="6" showInDefault="1" showInWebsite="0" showInStore="1">
                label
                <field id="data_type_map" translate="label" type="Magento\Config\Block\System\Config\Form\Field\File" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="1">
                    label
                    <backend_model>Vendor\Module\Model\Config\Form\Field\CsvFile</backend_model>
                    <upload_dir scope_info="1">import/catalog/product/config</upload_dir>
                </field>
            </group>

    </system>
</config>

So when i request the config value with

$this->scopeConfig->getValue(self::XML_PATH_DATA_TYPE_MAP, $scopeType, $scopeCode);

I get something like "default/foo.csv" but what i want is import/catalog/product/config/default/foo.csv

Is there a way to get the value like this or to read the upload_dir from the configuration without using it as a static string?


texts: im using Magento ver. 1.9.0.1 and no Transaction emails are being sent at all. The customer does not get a order conformation email. The admin does not get an order email. And when you sign up you dont get a welcome email. There are no errors in the logs and my hosting company says everything is good on their end. I have also installed SMTP pro when I ran the test with in SMTP pro it did send the test email and I recivied it. But still no other emails are sent out. Can some one help me figure this out.


texts: Configureable product with 1 option but no dropdown

texts:
Based off Product different prices and options per customer group say if you had

3 simple products

1 box - 700g
8 boxes - 700g
12 boxes - 700g

And 2 configurable products

Retail configurable product - All three simple products are associated
Trade configurable product - Only 8 boxes - 700g is associated

Is it possible to  hide the dropdown on the trade configurable product as there is only 1 option? I know you can use extensions such as https://github.com/tzyganu/Switcher to set defaults but I want to hide the dropdown completely as if they can only choose 1 option then its pointless.

I know some of you will say "well just use a simply product with no associated products" however the issue here is that we would need to manage 2 stock levels, 1 for trade and 1 for retail. In reality the stock is all the same and we dont have different levels for different customer groups


texts: Magento 2 Completely cancel/remove module

texts:
I installed some extensions manually some time ago, without composer.
Now I'd like to delete them.

  Is there a way to permanently delete them?

Now they are disabled. Especially some extensions that are like "Backend Shared Extension"

I enclose some text written by the removal form guide:

  Important: If you are using other WeltPixels extensions make sure not to remove the 'Backend' shared extension as is used by the rest of WeltPixel installed extensions. WeltPixel extensions it is safe to uninstall and remove also the 'Backend' extension.

Thank you.

Magento 2.2 CE


texts:
I need to pass the whole header to another website through an API.

Do not ask why, this is the task.

I asked some help from one of my colleague, he suggest me to create a controller, what has a layout and block only with header, get it from API with curl or file_get_contents (does not matter).

Somehow I feel this is a workaround.

Does anybody do like this, is there a more elegant solution?


texts: Magento 2: How redirect from controller to another controller to POST method?

texts:
I am trying to redirect the customer when their store view is not correct. When I redirect the _request method it is GET and I need it to be POST

  if ($currentStore !== $customerStore) {
       $params = $this->getRequest()->getParams();
       $url = $this->_url->setScope($customerStore)->getUrl('customer/account/loginPost', $this->getRequest()->getParams());
       $resultRedirect = $this->resultRedirectFactory->create();
       $resultRedirect->setUrl($url);
       return $resultRedirect;
   }


texts: How do I remove the category title on category pages for Magento 2?

texts:
I am trying to remove the category title on category pages on Magento 2.1.8. I got this page  vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml and removed this-

 <referenceBlock name="page.main.title">
        <arguments>
            <argument name="id" xsi:type="string">page-title-heading</argument>
            <argument name="add_base_attribute_aria" xsi:type="string">page-title-heading toolbar-amount</argument>
        </arguments>
        <block class="Magento\Catalog\Block\Category\Rss\Link" name="rss.link" template="Magento_Catalog::category/rss.phtml"/>
    </referenceBlock>

I took that file and added it to app/design/frontend/mytheme/theme/module-catalog/view/frontend/layout/catalog_category_view.xml

I cleaned and flushed the cache and it didn't work. So I did a little bit of research and came across this-

https://stackoverflow.com/questions/42220806/magento2-how-can-override-vendor-module-catalog-to-magento-default-theme

and it recommended putting it in this folder

app/design/frontend/mytheme/theme/Magento_Catalog/module-catalog/view/frontend/layout/catalog_category_view.xml

I tried that, flushed and cleaned the cache and still nothing. What am I doing wrong?


texts:
I've the following observer

<events>
  <sales_quote_add_item>
    <observers>
      <priceupdate_observer>
        <type>singleton</type>
        <class>termostore_scontitrovaprezzi/observer</class>
        <method>applyDiscount</method>
      </priceupdate_observer>
    </observers>
  </sales_quote_add_item>
</events>

And the following method

public function applyDiscount(Varien_Event_Observer $observer)
  {
    $event = $observer->getEvent();
    $item = $event->getQuoteItem();
    $product_id = $item->getId();

    function setPrice($new_price){
      $item->setOriginalCustomPrice($new_price);
      $item->save();
    }

    switch($product_id){
        case 22116:
            $new_price = 1000;
            setPrice();
            break;
        case 22076:
            $new_price = 1000;
            setPrice();
            break;
        case 37476:
            $new_price = 500;
            setPrice();
            break;
        case 22115:
            $new_price = 500;
            setPrice();
            break;
        case 22077:
            $new_price = 500;
            setPrice();
            break;
        default:

            break;
    }
}

It doesn't work and I believe the problem is in getting the product ID. What am I doing wrong?

EDIT
The error says something like: It's not possible to add the item to the cart.


texts: After migration from 1.8.x to 1.9.3 admin image browse button not working

texts:
I have migrated my magento from 1.8.x to 1.9.3 but after that magento product image browse file button is not working, if I click browse button it doesn't do anything.

in console I can see error like

  Uncaught ReferenceError: Uploader is not defined(…)

I can see already existing images and working fine in both admin and front end.


texts: Adminhtml form custom renderer - blank page - Magento 1.9

texts:
Added custom element to my adminhtml form. It works perfectly fine on my developement site but it won't on production ....
the only difference was on dev i made it as a module while on production I just copied core files into local and made all the changes.But then I cleaned it up and installed module to make sure everything is "identical" but it still won't work. Once I enable renderer -> blank page. Disabled renderer is giving me a standard text/input element.
This is my form custom element

$mySlides = $fieldset->addField('mySlides', 'text',
        array(
            'name'      => 'mySlides',
            'note'      => 'pafka',
    ));
    $renderer = new Mage_Adminhtml_Block_Cms_Block_Edit_Table_Renderer;
    $mySlides->setRenderer($renderer);

and my renderer:

class Mage_Adminhtml_Block_Cms_Block_Edit_Table_Renderer extends arien_Data_Form_Element_Abstract
{
    public function render(Varien_Object $row)
    {
    $collection = Mage::getModel( 'cms/block' )
        ->getCollection()
        //->addAttributeToSelect('position')
        ->addFieldToFilter( 'is_active', 1 )
        ->addFieldToFilter( 'is_slide', 1 )
    ;
    $collection->setOrder('position','ASC');

    $style = '';
    $jquery = '';
    $tableTop = '
';
    $media = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
    foreach($collection as $id){
        $slitle = $id->getTitle();
        $slid = $id->getID();
        $simage = str_replace(' ','',$id->getData('mobileslide'));
        $tableMid .= '
'.$id->position.'
';
    }
    $tableEnd = '
';
    $script = '';
    $slides = $style.$jquery.$tableTop.$tableMid.$tableEnd.$script;
    $this->_slides = $slides;
    return $slides;
}

}

renderer is placed in: /app/code/local/Mage/Adminhtml/Block/Cms/Block/Edit/Table file name is Renderer.php

Any ideas ??
that's how it look like on my dev:

Not sure where to look as there is no errors or anything what can point me to the issue. How can I find what is the problem ?
I think the only problem can be a admin path but have no clue how to check it.
Please help!
found something in the meantime:
h t t p s ://mywebsite/index.php/eska/cms_block/edit/block_id/317/key/59aabbdd1385e396f..........108bb/ 500 (Internal Server Error) when the renderer is called aparently, but still can not find what cause this issue. There is no errors in code.


texts: How get custom Table Data in phtml file without creating Model file. Magento 2

texts: I created custom table in my database through phpmyadmin, now I want display top1 record from that table on home page, and top2,top3 records need to display in product details page.


texts:
I'm still working my way around Magento so I apologize ahead of time for my lack of knowledge.  I have a custom report with the collection coming from the a model.  I need my report to show only one vendor that I specify.  I have an attribute, manufacturer_label, coming from the model into a column in the grid.  That is the vendor name.  I just need the grid to show orders from only one vendor that I specify.  Is this something I can do in the _prepareCollection() function?

protected function _prepareCollection()
{
    parent::_prepareCollection();
    // Get the data collection from the model
    $this->getCollection()->initReport('vendorreport/vendorreport');

    return $this;
}

Inside _prepareColumns() I'm adding the Vendor column like this in case it helps:

    $this->addColumn('manufacturer_label', array(
        'header' => Mage::helper('vendorreport')->__('Vendor'),
        'align' => 'right',
        'sortable' => true,
        'index' => 'manufacturer_label'
    ));


texts: Magento 2 - images in store config (per radio button)

texts:
I have currently installed Magento 2.3.x and I want to create a radio field in system config with an image (please look at the screenshot below).

What is the best practice to do that? I am not so satisfied with my solution (images in base64). Where should I store images for module purposes? I need to distribute it with a module.
Config definition:
<field id="catalog" translate="label" type="radios" sortOrder="100" showInDefault="1" showInWebsite="0" showInStore="1">
    Catalog page design
    <source_model>Namespace\Module\Model\Config\Source\Foo</source_model>
</field>

Source model code:
<?php

    namespace Namespace\Module\Model\Config\Source;

    class Foo implements \Magento\Framework\Data\OptionSourceInterface
    {
        public const IMG_CATALOG_BUTTON = 'data:image/png;base64, ..... ';
        /**
         * @inheritDoc
         */
        public function toOptionArray()
        {
            return  [
                [
                    'value' => 'test',
                    'label' => __('Minimalistic variant') . " ",
                ],
                [
                    'value' => 'production',
                    'label' => __('Page strip variant') . " ",
                ],
            ];
        }
    }

Please can you help me with the best practices in M2? (I working many years with M1). Thanks!


texts: SUPEE 8788 file 0 created in root directory

texts: In PATCH_SUPEE-8788_CE_1.9.2.4_v1-2016-10-11-07-03-46.sh, an empty file 0 is created in the Magento root directory. Should this be deleted? What's it's purpose?


texts: Unable to add new table from InstallScheme magento2

texts:
I have created an installschema for my custom table to be created.

<?php
namespace Vendor\Module\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface
{

    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $installer = $setup;
    $installer->startSetup();
     /**
     * Create new table 'my_table1'
     */
    $table = $installer->getConnection()
        ->newTable($installer->getTable('my_table1'))
        ->addColumn(
            'id',
            \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            null,
            ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
            'ID'
        )
        ->addColumn(
            'product_id',
            \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            null,
            ['unsigned' => true, 'nullable' => false, 'default' => '0'],
            'Product ID'
        )
        ->setComment('My new table');
    $installer->getConnection()->createTable($table);
    $installer->endSetup();
   }
}

And I gave setup:upgrade, but Im not able to see my custom table in the database.
Where is my code wrong?


texts: Change order of totals for emails and pdf invoices

texts:
I am having trouble changing the order of totals in sales emails and pdf-s

I have tried these thing I read on this forum:

1) Changed order of totals in admin side system->configuration->sales->checkout totals sort order
2)coping /app/code/core/Mage/Sales/etc/config.xml lo local and editing

No results though, what else to do?

update - I got the totals right in pdf-s
I guess the config.xml worked or smth
But the e-mails are still wrong

img to iilustrate what I am tryimg yo do


texts: How can I load the product collection without some products?

texts:
Actually, I want to load the product collection except for some products. I have the product ids that I don't want in the collection. For example, the product ids that I don't want in the product collection is like

$productIds = array(10,20,30);

How can I do this?


texts: Custom Payment Method Not Showing in Frontend

texts:
I've created a new payment method in Magento1.7. But it's not showing up in frontend. In the backend, options are showing. Below is the code,

config.xml

<config>
    <modules>
        <Company_TelephoneOrder>
            <version>0.1.0</version>
        </Company_TelephoneOrder>
    </modules>
    <global>
        <helpers>
            <telephoneorder>
                <class>Company_TelephoneOrder_Helper</class>
            </telephoneorder>
        </helpers>
        <models>
            <telephoneorder>
                <class>Company_TelephoneOrder_Model</class>
            </telephoneorder>
        </models>
    </global>
    <default>
        <telephone_payment>
            <telephone_order>
                <active>1</active>
                <order_status>pending</order_status>
                <sort_order>100</sort_order>
                <title>Telephone Order</title>
                <allowspecific>0</allowspecific>
                <model>telephoneorder/telephone</model>
            </telephone_order>
        </telephone_payment>
    </default>
</config>

Telephone.php

class Company_TelephoneOrder_Model_Telephone extends Mage_Payment_Model_Method_Abstract
{
    protected $_code = 'telephoneorder';
    protected $_isInitializeNeeded = true;

   protected $_canUseInternal = true;

 protected $_canUseForMultishipping = true;

}


texts: Add shipping charges before login or entering customer details in onepage review block

texts:
I am using onepage checkout extension, I wish to add shipping charges of products to be added in review block before login and entering customer information.
Let us take an example, product having a cost of  Rs.430 and its shipping charge is Rs.80(set from backend for every product), then I just want to show 430+80 in review block, without entering any details and before login at onepage checkout page.Kindly refer to the attached screenshot for the same.


texts:
I managed to fix this issue following this Question:

CE1.9.1 Please make sure your password match issue during User registration

But the error still occurs when Checking out, and registering from a the Mobile.

I'll appreciate any help on the issue.


texts: Highlight attribute name in product edit form

texts:
I need to highlight some divs with attribute names in product form in Magento2. Is there some way to do so? Or, at least, give me a hint where to look.
I can't even find where attributes are loaded by fieldset. My guess is this is done in js somewhere. Solution would be something like adding a custom css class to all attributes that I want to be highlighted, but that's just my guess, and I don't know how to do that either, to be frank.


texts: How to clear billing form validation errors when using Magento UI components

texts:
Default magento checkout behavior when using new customer billing address form (related to newCustomerBillingAddress name in the local storage).

we uncheck "My billing and shipping address are the same" checkbox
the new customer billing address form is shown
we start to fill some data into the fields. for example "first name".
we remove this "first name" value and we see validation error
we click again "cancel" at the bottom or the checkbox "my billing and shipping address are the same"
form is hidden
we uncheck the "my billing and shipping address are the same"
we see the form and the validation errors

My questions are related to step nr 7 and 8.

Q1: how to clear validation errors in the form when action in step 7 happens and we see form (step 8) ? How to do it when we show form using our custom functions to show/hide form and select different addresses (when user is logged) ? I would like example of function that I could put into view/billing-address.js that will clear validation error in/after step nr 8.

Q2: Why if user click "cancel" magento saves the changed input values? I guess it's because keyUp event in Magento Ui?

I've made some changes that if:

p1. user fill the form and click "save". data is valid so store in some observable/localStorage

p2. user edits the form data. Ex. He removes the first name field.. but than he clicks cancel button

in p2 step  I compare previous valid form data to the new form data.

If the field has different value than I restore the valid one and I have to trigger keyUp for fields that were modified to hide the validation error.

I know I do it the wrong way... but how can I access in billing-address.js every billing address form's field (to set new value / clear validation / revalidate) ?

extra question - why magento2 knockout's billing-address.js methods are executed in every payment method scope (this.dataScopePrefix) even if we turn on in store only one or two or X payment methods?


texts: Magento2 Around Plugin vs Preference. Which option is better?

texts:
I think I don't need to explain in detail about plugins, preferences and observers. These are types of overriding or extending default magento functionality.

While overriding any magento core method/function, you must think first about which way to prefer. Whether it is plugin, observer or preferences. Observers can work only in some specific cases while in most of the cases you need to choose between plugin and preference.

Many times, I enters into the situation where I need to choose between around plugin and preference. You can imagine such case in that before and after plugins can't work for you. So this is really hard decision for me to choose between these two.

If you choose around plugin then it will call the method twice before and after the method execution. It means it may execute all code written in that method twice.

If you choose preference then your custom code or say custom feature might stop work if there is any change comes into the core method in future magento upgrade versions.

So this is really hard decision for me to choose the right approach. I am not sure how many of you had faced such situation but I would like to know about the best option to choose from this.

You can share your views with pros and cons.

Thanks,


texts: How to write condition to set free shipping for particular US states in "Shopping Cart Price Rules"?

texts:
I want to enable free shipping if the state is Massachusetts and Order Total Amount is <=250$ or if the state is Connecticut and Order Total Amount is <=500$. How to implement this condition in Shopping cart Price Rules ?
Thanks in Advance.


texts: I am unable to change the Admin URL for magento 2. The URL is still redirecting to old site

texts:
the magento admin URL  site keeps redirecting to the old site URL.
I have used every converstional method to change the URL but its still redirecting.
I.e
I change the url in my env.php i cleaned my cache.
I tried setting  it by command line : setup:config:set --backend-frontname="admin"
Each time I did the following:
maintenance:enable

 setup:upgrade;
 setup:static-content:deploy -f;
 setup:di:compile;
 maintenance:disable;
 index:reindex;
 cache:flush;
 cleared the cache,

I even  inserted the new name into database table:
i.e
INSERT INTO `core_config_data`(`scope`, `scope_id`, `path`, `value`)
VALUES(
'default', # Or whatever your Scope is
0, # Or whatever your Scope ID is
'admin/url/custom',
'https://mysite.test/admin/'
);

any ideas where it might be set?


texts: What does Magento coookie $secure variable do?

texts:
Could anyone be kind and explain what is the good practice for setting cookies in Magento with:

Mage::getModel(‘core/cookie’)->set($name, $value, $period, $path, $domain, $secure,$httponly);

I am especially interested what the $secure and $httponly do.


texts: Magento 2 : How to get Custom module's 'web' directory path/Get custom module image directory path

texts:
I have created a custom module in which I want to check if a (image)file exists in my view/frontend/web/images folder.

I have checked this answer but in only shows how to get Magento's directory paths.

How can I get full path for my module's directory which will support with Magento 2's static content deploy feature?

EDIT

As per Rakesh's answer I can use below code.

$mediapath = $this->_filesystem->getDirectoryRead(DirectoryList::APP)->getAbsolutePath();
$modulePath = echo $mediapath.'code/Packagename/Modulename/view/frontend/web/images';

Is there any other alternative to this approach?


texts: Display custom products based on form entries

texts: I m trying to replicate policybazaar[dot]com for a client. Is it possible to show products based on form filled by a user? The form will contain fields with predefined options. The user fills the fields and on the basis of combination of values of diffrent fields, I wish to show products. I have not used magento so a detailed help with be appreciated, Thanks :)


texts: Import new and update products and their attributes with a CSV file and cron job Magento2

texts:
I am using Magento 2.3.3 and wants to import products using cron and csv. I have google Sheet which contains all products data and sheet's data changes continuously. So I have to run a cron every day which updates product price, qty and some attributes values.

I've generated csv from sheet and it is being successfully imported manually.
Then I tried to import csv using cron by hitting some import functions existing in module-
import-export. But didn't work and everything messed up.
Now I'm trying to import products by directly save them in database.

Is it possible to do that? Or is their another way?
Checked this link also but didn't understand that much.


texts: move My Cart block to header ONLY with local.xml

texts:
Is it possible to move the Cart block from the sidebar to the header, ONLY with the local.xml file?

This is not working:

<reference name="right">
    <action method="unsetChild"><alias>cart_sidebar</alias></action>
</reference>
<reference name="header">
    <action method="insert"><blockName>cart_sidebar</blockName></action>
</reference>


texts: shipping charge display in cart without shipping address detail in magento 2

texts:
I am using magento 2.3.4, and trying to show shipping charges in cart page, without enter the shipping detail. it should be only based on grand total of cart.
for that i found some blog but not helped.
condition like :
price 50 <= 300
price 0 >=300
How should i implement this condition either by any config setting or programattically?


texts: Checkout option of Ajax Cart Popup does not redirect to one step checkout

texts:
I am using Ajax Cart Popup
http://www.magentocommerce.com/magento-connect/ajax-cart-popup.html

And One step checkout extensions.
But when I click on check out button in popup cart, it redirects me to default one-page checkout. I want it to redirect me to one step checkout page.

What is needed to be changed?


texts: Estimating shipping rate on product details page in Magento2

texts:
I want to display estimate shipping on detail page. User will check shipping cost from product detail page like same as cart page.

Any one have complete this function. Kindly give your suggestion on this.

Thanks


texts: Magento 2 would like to override configurable.js method form custom module

texts:
Here I would like to override the configurable.js there is a method _fillSelect  The below method is working for preselecting the first children. I would like to override from my custom module what are the steps need to follow here.

_fillSelect: function (element) {
    var attributeId = element.id.replace(/[a-z]*/, ''),
        options = this._getAttributeOptions(attributeId),
        prevConfig,
        index = 1,
        allowedProducts,
        i,
        j;

    this._clearSelect(element);
    element.options[0] = new Option('', '');
    element.options[0].innerHTML = this.options.spConfig.chooseText;
    prevConfig = false;

    if (element.prevSetting) {
        prevConfig = element.prevSetting.options[element.prevSetting.selectedIndex];
    }

    if (options) {
        for (i = 0; i < options.length; i++) {
            allowedProducts = [];
            if (prevConfig) {
                for (j = 0; j < options[i].products.length; j++) {
                    // prevConfig.config can be undefined
                    if (prevConfig.config &&
                        prevConfig.config.allowedProducts &&
                        prevConfig.config.allowedProducts.indexOf(options[i].products[j]) > -1) {
                        allowedProducts.push(options[i].products[j]);
                    }
                }
            } else {
                allowedProducts = options[i].products.slice(0);
            }

            if (allowedProducts.length > 0) {
                options[i].allowedProducts = allowedProducts;
                element.options[index] = new Option(this._getOptionLabel(options[i]), options[i].id);
                if (typeof options[i].price !== 'undefined') {
                    element.options[index].setAttribute('price', options[i].prices);
                }

                element.options[index].config = options[i];
                index++;
            }
            // Code added to select option
            if (i == 0) {
                this.options.values[attributeId] = options[i].id;
            }
        }
        //Code added to check if configurations are set in url and resets them if needed
        if (window.location.href.indexOf('#') !== -1) {this._parseQueryParams(window.location.href.substr(window.location.href.indexOf('#') + 1));}
    }

},


texts: Magento multi store views with rel="alternate"

texts:
I'm running single Magento 1.7 installation with 2 store views.
I have two domains which are search engine optimized for Ireland and UK.
Since content is very similar I would like to use rel="alternate" hreflang="XX":

<link rel="alternate" hreflang="en" href="http://domain.ie/" />
<link rel="alternate" hreflang="en-gb" href="http://domain.co.uk/" />

Is there a easy solution / plugin that will allow me to choose relation between those two store views for product / category / text page?


texts:
I have a magento 2.1 shop with order I want to move to a different magento 2.1 store via DB.  Is it as easy as moving the sales_ tables?  Do I need them all?  Do I need other tables?

sales_bestsellers_aggregated_daily
sales_bestsellers_aggregated_monthly
sales_bestsellers_aggregated_yearly
sales_creditmemo
sales_creditmemo_comment
sales_creditmemo_grid
sales_creditmemo_item
sales_invoice
sales_invoiced_aggregated
sales_invoiced_aggregated_order
sales_invoice_comment
sales_invoice_grid
sales_invoice_item
sales_order
sales_order_address
sales_order_aggregated_created
sales_order_aggregated_updated
sales_order_grid
sales_order_item
sales_order_payment
sales_order_status
sales_order_status_history
sales_order_status_label
sales_order_status_state
sales_order_tax
sales_order_tax_item
sales_payment_transaction
sales_refunded_aggregated
sales_refunded_aggregated_order
sales_sequence_meta
sales_sequence_profile
sales_shipment
sales_shipment_comment
sales_shipment_grid
sales_shipment_item
sales_shipment_track
sales_shipping_aggregated
sales_shipping_aggregated_order


texts: Product attribute apply_to all product type

texts:
I have an attribute (body_fit) present only for a simple product, now I need this attribute present for virtual and configurable products.

How I can change this configuration?
What happens if I change this option via PHPMyAdmin?

I have 600 products with this attribute set.

Any help is appreciated!


texts: Actually i am facing one error while sending email programmatically magento2?

texts:
Here I am using default contact us email template from admin panel magento 2.

  app/code/Vendor/Module/Controller/Index/Contact.php

<?php

    namespace Vendor\Module\Controller\Index;

    use Magento\Framework\App\Action\Action;
    use Magento\Framework\Controller\ResultFactory;
    use Magento\Framework\App\Request\DataPersistorInterface;

    class Contact extends Action
    {
            private $dataPersistor;

        protected $_transportBuilder;
        protected $inlineTranslation;
        protected $scopeConfig;
        protected $_messageManager;
        protected $_storeManager;

        public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
        \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Framework\Message\ManagerInterface $messageManager,
                \Magento\Store\Model\StoreManagerInterface $storeManager,
                        array $data = []
       ) {
            parent::__construct($context,$transportBuilder,$inlineTranslation, $scopeConfig,$data,$storeManager);
            $this->_transportBuilder = $transportBuilder;
            $this->inlineTranslation = $inlineTranslation;
            $this->scopeConfig = $scopeConfig;
            $this->_messageManager = $messageManager;
            $this->_storeManager = $storeManager;
        }

        public function execute()
        {
            $post = $this->getRequest()->getPostValue();
            $fromEmail= 'shop@xyz.com';
            $fromName = 'Email Testing';

            $templateVars = [
            'name' => $post['firstname'],
            'email' => $post['email'],
            'telephone' => $post['phone'],
            'message'   => $post['message']
            ];
            $from = ['email' => $fromEmail, 'name' => $fromName];
            $this->inlineTranslation->suspend();

            $to = 'dyane@gmail.com';

            $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;

            $templateOptions = [
            'area' => \Magento\Framework\App\Area::AREA_FRONTEND,
            'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID
            ];

            $transport = $this->_transportBuilder->setTemplateIdentifier(6, $storeScope)
            ->setTemplateOptions($templateOptions)
            ->setTemplateVars($templateVars)
            ->setFrom($from)
            ->addTo($to)
            ->getTransport();
            $transport->sendMessage();
            $this->inlineTranslation->resume();

            $this->messageManager->addSuccess(__('You sent the contact details successfully.'));
            $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
            $resultRedirect->setUrl($this->_redirect->getRefererUrl());
            return $resultRedirect;

        }
    }

  Below is Error

This page isn’t working
site is currently unable to handle this request.
HTTP ERROR 500


texts: Can i get all customers, along with their address information, using the REST api?

texts:
I'm using Magento version 1.9, and i'm trying to get all my customers, via the REST API.

That is working fine. But i also need the phone number for each customer, and then have to make a seperate API call, per customer, to get their address, and extract the phonenumber from that address.

Is there a way to either get the phone number, or their address, in the same call, that gets the list of customers? Maybe with a parameter.


texts:
Has anyone see a way to integrate a html help system into magento admin?

For example, on a admin page, include a button which links to a context sensitive help file

I know there are a few links in admin which point back to magento wiki pages, however I wanted to build my own integrated help files

thanks
Brendan


texts: Base table or view not found custom database

texts:
It seams I can't get the table from my custom database.

My module should list all data from the database frontend(and backend later)
But I get this error

  a:5:{i:0;s:93:"SQLSTATE[42S02]: Base table or view not found: 1146
  Table 'ifp.mage_emailorder' doesn't exist";i:1;s:4318:"#0
  /var/www/ifp.dk/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
  Zend_Db_Statement_Pdo->_execute(Array)

What I can read on the net. Eather its the database setup, or the block I use to call it out.

Database setup

app/code/local/Puk/EmailOrder/sql/emailorder_setup/mysql-install-0.1.0.php

<?php
$installer = $this;
$installer->startSetup();
$sql=<<<SQLTEXT
create table emailorder(
    emailorder_id int not null auto_increment,
    order_date varchar(255) not null,
    product_name varchar(255) not null,
    location varchar(255) not null,
    date_for varchar(255) not null,
    name_title varchar(100) not null,
    email varchar(255) not null,
    company varchar(255) not null,
    adress varchar(255) not null,
    zipcode varchar(255) not null,
    city varchar(255) not null,
    phone varchar(255) not null,
    comment text not null,
    order_done int not null default 0,
    primary key(emailorder_id)

);

SQLTEXT;

$installer->run($sql);
//demo
//Mage::getModel('core/url_rewrite')->setId(null);
//demo
$installer->endSetup();

The block

app/code/local/EmailOrder/Block/Monblock.php

<?php
class Puk_EmailOrder_Block_Monblock extends Mage_Core_Block_Template
{
     public function methodblock()
     {

        $retour='';
     $collection = Mage::getModel('emailorder/emailorder')->getCollection()
                                 ->setOrder('emailorder_id','asc');

        foreach($collection as $data)
        {
             $retour .= $data->getData('product_name').' '.$data->getData('location')
                     .' '.$data->getData('date_for').'<br />';
         }

         Mage::getSingleton('adminhtml/session')->addSuccess('YES!');
         return $retour;
      }
}

Can someone help? :)


texts: New Server Install, restored database, all pages 404

texts:
I have a new server, it is Nginx using mysql. I have been developing code locally on a MAMP install. I then migrated this code to git and moved a copy of the database to the new server.

I configured Nginx and restored this database to the new server. All pages, both frontend and backend resolve to the magento 404 page (not the nginx 404 page)
This tells me that I am getting into the Magento application but something is not quite right.

I then tried to view the logs in the magento/var/log directory, specifically the system.log and exception.log. No logs are getting generated. I thought this was a permission issue, so I placed a snippet of code in the Mage.php file. This code is:

Mage::log('Test', null, 'test.log');

This results in a log file getting created.
Since I do not have access to the admin area, I went into the database and made sure that the following keys are set:

dev/log/active = 1

dev/log/exception_file = exception.log

dev/log/file = system.log

scope_id = 0

in the core_config_data table.

I went to the magento index.php page and set the following:

 ini_set('display_errors', 1);

Still am not getting any logs as to the 404 problem.
Just to test, I browsed to the install.php page and was given an error message and a log was generated.

I was thinking this was a user related problem.
Here is my setup:

Nginx runs under the Nginx account
I have a group called webdev

Nginx is a part of this group

The Magento application is under the magentodev account, which is a member of the webdev group


texts:
I'm running magento in local on Xampp.
I'm trying to create a soap service but I have this error.
When i try this URL : http://localhost:8080/magento/api/v2_soap/?wsdl
I see the xml document but when i try http://localhost:8080/magento/api/v2_soap/index I have the PHP error that you can see below.
After that all my magento projects are redirected to wizard installation. But when I close and reopen my xampp all project are come back and are accessible!

Where is the problem? There is something else to configure for running a soap API?

<SOAP-ENV:Envelope><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>WSDL</faultcode>
<faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from
     'http://localhost:8080/magento/index.php/api/v2_soap/index/?wsdl=1' :
 failed to load external entity
     "http://localhost:8080/magento/index.php/api/v2_soap/index/?wsdl=1"
</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

In my log file I had

[26-Jun-2014 09:28:52 UTC] PHP Fatal error:  SOAP-ERROR: Parsing WSDL:
Couldn't load from 'http://localhost:8080/magento/index.php/api/v2_soap/index/?wsdl=1'
: failed to load external entity
"http://localhost:8080/magento/index.php/api/v2_soap/index/?wsdl=1"
 in C:\xampp\htdocs\magento\lib\Zend\Soap\Server.php on line 811

In this line of code I have. I don't know if it can be useful

  protected function _getSoap()
{
    $options = $this->getOptions();
    $server  = new SoapServer($this->_wsdl, $options); **<- I had this

    if (!empty($this->_functions)) {
        $server->addFunction($this->_functions);
    }


texts: How to walk through a collection with pagination

texts:
I working on a command line which is fetching all the products in the database, using the Magento\Catalog\Model\ResourceModel\Product\CollectionFactory object.

In order to avoid memory problems, I'm going to process the data in chunks, so using the methods setPageSize and setCurPage to fetch just a portion of the whole dataset and walking through it.

I notice, perhaps the setCurPage value passed was increasing, the data returned are the same all the times.
Is there any method I need to call in order to clear the Collection cache if any? Or is there a better way to walk and process the data from the collection?

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;

use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Framework\App\State;
use Magento\Framework\App\Area;

class ExportProducts extends Command
{
    public function __construct(
        CollectionFactory $collectionFactory,
        State $state
    ) {
        $this->collectionFactory = $collectionFactory;
        $this->state = $state;

        parent::__construct();
    }

    protected function configure()
    {
         // Command description
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $this->state->setAreaCode(Area::AREA_GLOBAL);

        $productCollection = $this->collectionFactory->create();
        $productsQty = $productCollection->getSize();

        $pageSize = 25;
        $break = false;
        $page = 1;
        $count = null;
        $lPage = null;

        while ($break !== true) {
            $productCollection
                ->addAttributeToSelect('*')
                ->setOrder('entity_id','ASC')
                ->setPageSize($pageSize)
                ->setCurPage($page)
                ->load();

            $output->writeln($page);

            if($count === null) {
                $count = $productCollection->getSize();
                $lPage = $productCollection->getLastPageNumber();
            }

            if($lPage == $page) {
                $break = true;
            }

            $page++;

            foreach ($productCollection as $product) {
                $id = $product->getData('entity_id');
                $pr = $objectManager->create('Magento\Catalog\Model\Product')->load($id);
                /** Here I'm working with the data coming from $product and $pr **/
            }
        }
    }


texts:
we are having a little issue, maybe some smart person knows a fix?
We have a few different locales, e.g. NL and UK.
A typical product has a different name for both countries, thus a different url_path. Like this:
UK -> store.com/uk-productname.html
NL -> store.com/nl-productname.html

Now, when you enter the store from another, for example Google URL, like this:
NL -> store.com/uk-productname.html
This results in a 404 page (and this happens a lot I might add).

We have created a 404 page with a link like this on it:

<a href="?___store=locale_store_nl">

However, this is not foolproof.When you're e.g. already in the right locale but with the wrong locale url_path, you have to click a couple times from 1 locale to the other to get the right product view. Customers lost by then.

How can we make sure these 404 errors do no longer exist. We have a .nl domainname as well, but we wanted to keep everything in the .com version this time. In the .nl domain we have an htaccess file that does this, but that only helps when WE put the link somewhere. Anybody sharing or pasting the link they then see elsewhere, will send their visitors to the 404 because of the default locale of the UK version.

RewriteRule ^(.*)$  http://www.store.com/$1?___store=locale_store_nl [QSA,L]

A 404 extension that just catches all 404s doesn't work, because this creates a loop somehow.
We need something that knows the NL product url_path belongs to the NL locale, and not go to a 404 when entered through the UK locale.

I hope this made sense.

Who went through this before?

Thanks a lot.

ps. We have already setup a few links by hand in the URL rewrite management section by pointing to the exact product path, but once we clear our tables (have to because magento keeps increasing this table to enourmous sizes) those are gone again. Plus that is not the way to go IMO.


texts: how to select one manufacturer id of loaded products?

texts:
I want to select ids of a specific brand when I have the name and the Id of a product for example 111

I found out the ID of manufacturer by using getManufacturer()

I used this code in template/catalog/product/list.phtml :

$_productCollection=$this->getLoadedProductCollection();
$_collection_selected=$_productCollection->addAttributeToFilter('manufacturer', array('eq' => 111));
    foreach ($_collection_selected as $_product_selected):
                $product_selected_ids[]=$_product_selected->getId();
                 print_r($product_selected_ids);
            endforeach;

but it shows me all the products I don't know what is wrong?


texts: I cant able to place the order in magento 2

texts: **I cant able to place the order ** https://prnt.sc/t57wsd How to fix this


texts: Folder and file structure for state restriction module in Magento 2.3

texts:
I am new to Magento and am using the following "how to" guide to create a state restriction module in my Magento 2.3.3 instance: https://www.dckap.com/blog/how-to-restrict-specific-us-states-in-checkout-magento-2/

I am confused as to what to name the file at the end of step 1 that belongs in this folder: Dckap\CustomerAddresses\Model\Config\Region\RegionInformationProvider

Additionally, I need to override Magento\Directory\Model\ResourceModel\Region\Collection in step 3, and I am unsure as to where those files are located.


texts: How to apply cart rules directly on Order?

texts:
I have added a BIN promotion which is needed to be applied just before payment directly on order.
I have found 2 methods that apply discount but require a quote object.
\Magento\SalesRule\Model\Validator::canApplyDiscount
\Magento\SalesRule\Model\Validator::process
Have anyone directly applied on the order object?


texts: Special prices not showing in product pages

texts:
hope you can help me.

Using 2.1.7 CE.

Site is ready to go live except one frustrating issue I can’t work out.

I have just moved to production mode and turned caches on. Since then:

Special prices no longer appear in the product pages
In the category pages, products with a special price applied show “as low as” product price, rather than a strikethrough of the regular price. I have no tiers set up.

If I flush cache OR reindex:

Special price doesn’t not appear in the product page as described above UNLESS I open/refresh the product page of a product that has a special price immediately after flushing cache/reindexing. In this case, ONLY this product will display the special price on the product page - others will not display the special price. However, it doesn't appear to be browser related as if I clear browser cache/use another browser or device, again only this product will correctly show the special price while all others do not, as described above.
Although the product page does not show the special price, if I add it to the basket the special price is correctly applied.
There is no effect on the “as low as” issue.

Have considered it a theme issue and tried it with the Luma theme but the same problem persists.

Many thanks,

J


texts: Order details by invoice_id in Magento 2

texts:
How to get order details by invoice id? I need order details by invoice id.

I got this how to get order deatils by invoice id? but this is for magento 1


texts: Sync Prod. DB to Upgraded Staging. 1.8.1 to 1.9.1

texts:
I am in the process of Upgrading my Store from 1.8.1 to 1.9.1.

While I can upgrade to 1.9.1, the process along with testing might take about a week. As this is all done in a Staging Environment,

How can I sync the Orders, Customer, Product/Stock Updates etc. that happen in the Production server which is at 1.8.1. ?

Appreciate your time and Help.


texts:
I've checked in a number of magento 1.9 demo sites, as well as my own but can't work out what's stopping it being shown in all the responsive emulators - screenfly etc... Anyone shed some light on this for me?

Example http://clients-sherodesigns.com/newstore/ in http://quirktools.com/screenfly/


texts:
I wonder if there is a bug with taxes in magento.
For example:
I set inside configuration menu>Sales>Tax > all to Including Tax.
Fixed Product Taxes are not active.

Then I go to make a new product and set the price to 100, under the price it says "Inc. Tax" so my price 100 should be inc tax, correct?

Then I set Tax Class for my product which is 25%.

I flush the cache

Then I go to the store, but the price that is displaying is 125, not 100 as it should including tax. How does that come? Why does Magento add another 25% on the already taxed product?

Is it possible that the text "Inc. Tax" under price when you create a product should be ex. Tax instead? Cause when I type the ex.Tax price inside there which is 75 (100-25%=75) then the price in the store is correct, 100 inc. tax.

So, is it me or Magento? According statistics, there's a pretty big chance it's me...


texts: Magento 2: How to display messages in cachable pages

texts:
As a part of my functionality, using below I'm dispatching a conditional error message.

<event name="controller_action_predispatch">
    <observer name="controller_post_dispatch_sessionTimeout_message" instance="AAMC\Customer\Observer\SessionTimeoutMessage" />
</event>

public function execute(\Magento\Framework\Event\Observer $observer)
    {
        if(!$this->customerLoggedIn() && $this->_cookieManager->getCookie(CustomerHelper::LOGGED_IN_COOKIE)){
            $this->_cookieManager->deleteCookie(
                CustomerHelper::LOGGED_IN_COOKIE,
                $this->_cookieMetadataFactory
                    ->createCookieMetadata()
                    ->setPath($this->_sessionManager->getCookiePath())
                    ->setDomain($this->_sessionManager->getCookieDomain())
            );
            $this->_messageManager->addErrorMessage('Session time out. Please login to continue');
        }
    }

Messages are displaying only in uncacheable pages like customer, checkout but it failed to display messages in cacheable pages like home, product listing, product detail etc.

I've verified the same by disabling cache. Any help will be appreciated !


texts: In EE 1.13 clearing cache from Admin does not actually clean the cache

texts:
In magento EE 1.13 setup when I am clearing the cache from admin it does not clear the cache and my changes are not reflecting in frontend.

When I clear the cache directories from server my changes starts reflecting.

Is there anything that admin cache clean functionality is not working.


texts: How to save value of the new column in the “sales_flat_quote_item” for order decline remarks?

texts:
I created  a new column in sales_flat_quote_item named itemcomment. i want to to insert textbox value this column.

my form .....comment.phtml

<form id="orderapproval-item-form" class="orderapproval-hidden" action="<?php echo $this->getUrl('orderapproval/customercart/remarksdecline');?>" method="post">
    <input type="text" name="message" class="orderapproval-disabled" value="<?php echo $this->__('Enter decline reason'); ?>" id="decline" />
    <input type="submit" value="<?php echo $this->__('Decline'); ?>"/>
  </form>

CustomercartController.php

public function remarksdeclineAction()
{

           $message =  $this->getRequest()->getParam('message');
           //echo $message;
           $quoteItem  = Mage::getModel('orderapproval/quoteitem');
          $quoteItem->setItemcomment($message);
         $quoteItem->save();
}

controller is calling with echo

Model/Orderapproval.php

class ZetaPrints_OrderApproval_Model_OrderApproval extends Mage_Core_Model_Abstract

{
    public function _construct() {
        $this->_init('zetaprints_orderapproval/quoteitem','item_id');
    }

}

Model/Resource/Orderapproval.php

class ZetaPrints_OrderApproval_Model_Resource_OrderApproval extends Mage_Core_Model_Resource_Mysql4_Abstract
{
    public function _construct()
    {
        $this->_init('zetaprints_orderapproval/quoteitem','item_id');
    }

}

Model/Resource/Orderapproval/Collection.php

class ZetaPrints_OrderApproval_Model_Resource_OrderApproval_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
{
    protected function _construct()
    {
        $this->_init('zetaprints_orderapproval/quoteitem');
    }
}

config.xml

 <models>
      <zetaprints_orderapproval>
        <class>ZetaPrints_OrderApproval_Model</class>
        <resourceModel>zetaprints_orderapproval_resource</resourceModel>
      </zetaprints_orderapproval>
      <zetaprints_orderapproval_resource>
                <class>ZetaPrints_OrderApproval_Model_Resource</class>
                 <entities>
                    <quoteitem>

sales_flat_quote_item

                    </quoteitem>
                </entities>
            </zetaprints_orderapproval_resource>
      <sales>
        <rewrite>
          <quote>ZetaPrints_OrderApproval_Model_Quote</quote>
        </rewrite>
      </sales>
    </models>

<resources>
      <orderapproval_setup>
        <setup>
          <module>ZetaPrints_OrderApproval</module>
          <class>Mage_Eav_Model_Entity_Setup</class>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </orderapproval_setup>

      <orderapproval_write>
        <connection><use>core_write</use></connection>
      </orderapproval_write>

      <orderapproval_read>
        <connection><use>core_read</use></connection>
      </orderapproval_read>
    </resources>

but i am getting Fatal error: Uncaught Error: Call to a member function setItemcomment() on boolean

table name: sales_flate_quote_item
column name: itemcomment

Thanks.


texts: Can't add css_class to existing layout block in Magento2

texts:
I'm trying to add a CSS class name to a Layout block in Magento2.  It's for the My Orders link in the top .header.panel nav.

So far I've tried...

<referenceBlock name="company-customer-account-navigation-orders-link" htmlClass="hide-on-desktop" />

&

<referenceBlock name="company-customer-account-navigation-orders-link">
    <arguments>
        <argument name="css_class" xsi:type="string">hide-on-desktop</argument>
    </arguments>
</referenceBlock>

Neither of these work, is it at all possible?


texts: Category array values is empty in magento

texts:
I have a seperaed .php file and that is located in root folder. Which all are the code i need to include to get the magento predefined function. The following code i run in server and the getting category array values is null

require_once('/var/www/html/app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
mysql_select_db('test');

$product = Mage::getModel('catalog/product')->load('40185');
$cats = $product->getCategoryIds();

foreach ($cats as $category_id) {
   $_cat = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($category_id);
   print_r($_cat);
}

Result

 Mage_Catalog_Model_Category Object (

     [_eventPrefix:protected] => catalog_category
     [_eventObject:protected] => category
     [_cacheTag:protected] => catalog_category
     [_useFlatResource:protected] => 1
     [_designAttributes:Mage_Catalog_Model_Category:private] => Array
         (
             [0] => custom_design
             [1] => custom_design_from
             [2] => custom_design_to
             [3] => page_layout
             [4] => custom_layout_update
             [5] => custom_apply_to_products
         )

     [_treeModel:protected] =>
     [_urlModel:protected] =>
     [_defaultValues:protected] => Array
         (
         )

     [_storeValuesFlags:protected] => Array
         (
         )

     [_lockedAttributes:protected] => Array
         (
         )

     [_isDeleteable:protected] => 1
     [_isReadonly:protected] =>
     [_resourceName:protected] => catalog/category_flat
     [_resource:protected] =>
     [_resourceCollectionName:protected] => catalog/category_flat_collection
     [_dataSaveAllowed:protected] => 1
     [_isObjectNew:protected] =>
     [_data:protected] => Array
         (
             [store_id] => 1
         )

     [_hasDataChanges:protected] =>
     [_origData:protected] => Array
         (
             [store_id] => 1
         )

     [_idFieldName:protected] =>
     [_isDeleted:protected] =>
     [_oldFieldsMap:protected] => Array
         (
         )

     [_syncFieldsMap:protected] => Array
         (
         )

 )


texts: How to change "Use In Search Results Layered Navigation" option of attributes?

texts:
So I created a custom attribute called 'weight'.

When I search for a product in the Frontend, it shows 'Weight' in the Search Result options sidebar because I left "Use In Search Results Layered Navigation" to "Yes".

What's worse is that the unit for weight is set to dollars.

I just want to disable weight in the search options sidebar. But I can't. See image.


texts: failed to open stream: Permission denied on magento

texts:
I want to add a new module for export attributes in magento, so this is the module.

When I upload this module, I have this error in my system.log and I don't understand why it speaks to me of permissions because I already downloaded other modules without problem.

Can you help me thank.

This is my errors :

2017-07-29T09:51:13+00:00 ERR (3): Warning: include(C:\wamp\www\magento\app\design\adminhtml\default\default\template\importexportattributes\adminimportexportattributes.phtml): failed to open stream: Permission denied  in C:\wamp\www\easybuy\app\code\core\Mage\Core\Block\Template.php on line 241

2017-07-29T09:51:13+00:00 ERR (3): Warning: include(): Failed opening 'C:\wamp\www\magento\app\design\adminhtml\default\default\template\importexportattributes\adminimportexportattributes.phtml' for inclusion (include_path='C:\wamp\www\easybuy\app\code\local;C:\wamp\www\easybuy\app\code\community;C:\wamp\www\easybuy\app\code\core;C:\wamp\www\easybuy\lib;.;C:\php\pear')  in C:\wamp\www\easybuy\app\code\core\Mage\Core\Block\Template.php on line 241


texts: Trying to install Magento 2.3.6 - error Class Magento\GoogleShoppingAds\Model\Cache\Type does not exist

texts:
I am trying to run a magento install script (using deployer). The exact same script on exact same git branch works on another machine.
This is the error:
✔ Executing task deploy:prepare
✔ Executing task deploy:lock
✔ Executing task deploy:release
✔ Executing task deploy:update_code
✔ Executing task deploy:shared
✔ Executing task deploy:vendors
✔ Executing task mydebug
✔ Executing task deploy:clear_paths
✔ Executing task magento:setup:permissions
➤ Executing task magento:config
✔ Executing task deploy:failed
✔ Executing task deploy:unlock

In Client.php line 103: The command "cd /home/justadev/public_html/releases/20210226153919/ && /usr/local/bin/php /usr/local/bin/n98-magerun2 cache:enable --quiet" failed.

  In ClassReader.php line 26:
    Class Magento\GoogleShoppingAds\Model\Cache\Type does not exist

My previous release was using Magento 2.3.3, in this release I am trying to upgrade to Magento 2.3.6
The deploy script (with Magento 2.3.6) is also working on another server. I tried to disable the Magento_GoogleShoppingAds from app/etc/config.php and also remove it completely. It doesn't help.
I don't see this GoogleShoppingAds anywhere in my code. When I do bin/magento module:status it is in the disabled section. Where it is coming from and how can I remove it?
UPDATE
same issue happens with normal magento cache:flash
$ bin/magento cache:flush

In ClassReader.php line 26:

  Class Magento\GoogleShoppingAds\Model\Cache\Type does not exist

I added "magento/google-shopping-ads":"4.0.1" to composer.json, and I see that composer did install it:
$ ll vendor/magento/google-shopping-ads/
total 12
-rwxr-xr-x. 1 myuser myuser 691 Jun  1  2020 composer.json
drwxr-xr-x. 2 myuser myuser  41 Feb 26 16:11 etc
-rwxr-xr-x. 1 myuser myuser 218 Jun  1  2020 README.md
-rwxr-xr-x. 1 myuser myuser 274 Jun  1  2020 registration.php
drwxr-xr-x. 2 myuser myuser  50 Feb 26 16:11 Setup

However the issue is still happening.


texts:
I'm working on a custom shipping method linked with an external REST API.

When the seller submits a shipment, an API call is done in order to reserve a shipping course for our carriers.

The problem is that the cURL call fails with this error:

  cURL Error: name lookup timed out

I tried something like this :

$curlPostData = $bookCourseRequest; // an object containing the data sent to the API
$curlPostData = json_encode($curlPostData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);

$curlQuery = curl_init( //we will assume that the URL is correct );
curl_setopt($curlQuery, CURLOPT_POST, true);
curl_setopt($curlQuery, CURLOPT_POSTFIELDS, $curlPostData);
$header = array("content-type: application/json");
curl_setopt($curlQuery, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlQuery, CURLOPT_HTTPHEADER, $header);
curl_setopt($curlQuery, CURLOPT_CONNECTTIMEOUT, 30);
$curlAnswer = curl_exec($curlQuery);
if (!$curlAnswer)
    mage::log("cURL Error: " . curl_error($curlQuery));
else
    $answer = json_decode($curlAnswer);
curl_close($curlQuery);

Fun fact: this code works well on Magento 2 and on an PHP file unlinked with Magento. With Magento 1.9, there is a timeout error.

I tried the varian way but no luck: still the same error.

Does someone knows how to solve it?


texts: Magento 2 - How to map option value to sub item?

texts:
I have one configurable product and added few items which have product type as "Single"
For example :
Configurable product : Echo Fit Compression Short
Simple Product : Echo Fit Compression Short-29-Blue
Simple Product is generated based on size and color.
And In this point I want to add some option that client can choose.
For example, I added number of pockets.
And Once user click that option, It is save actually under the "configurable" item id not in the child item directly.
Is there anyway I can directly save that option value to the child item?
I found option saved in the configurable item in below table.
sales_order_item
Thank you.


texts: Magento 2 check if Page is used on more than one website

texts:
I'm trying to find if a page is used on more than one website on a multi-website Magento installation.
I have sucessfully return data of the page, but PageInterface has nothing like getStores() or getWebsites().
Here is my code:
public function getPageData($identifier){
        $searchCriteria = $this->_searchCriteriaBuilder->addFilter('identifier', $identifier,'eq')->create();
        $pages = $this->_pageRepositoryInterface->getList($searchCriteria)->getItems();
        return $pages;
    }

Thanks and Greetings!


texts: What is the recommended way to include small CSS customizations to an extension?

texts:
I've installed an extension and want to make some CSS customizations to the modal pop-up that it provides. There are basic options in the backend for styles, but I want to use CSS to write some custom changes.
I come from a background in WordPress, so there I'd just enqueue a CSS file in my theme directory and maybe store it in some sort of "integrations" folder in my theme so I can organize it and know that the file pertains to a specific plugin.
What would be a similar way to do this in Magento?


texts:
I've added jquery 1.8.2 to both my page.xml file and the corresponding directory.. however i am still getting multiple Uncaught ReferenceError: jQuery is not defined errors.

Jquery no conflict has been added.

In the page.xml file the script src is

<action method="addJs"><script>jquery-1.8.2.min.js</script></action>

and it is the first script.

    <block type="page/html_head" name="head" as="head">

<action method="addJs"><script>jquery-1.8.2.min.js</script></action>

        <action method="addJs"><script>prototype/prototype.js</script></action>

        <action method="addJs"><script>lib/ccard.js</script></action>

        <action method="addJs"><script>prototype/validation.js</script></action>

ect.


texts: Why can't grouped class name resolve correctly for frontend_model?

texts:
I have a frontend model set to a grouped class name of module/system_config_readonlyRenderer, however I receive this error:

PHP Fatal error:  Class 'Mage_Module_Block_System_Config_ReadonlyRenderer'

However, setting the class name directly to Package_Module_Block_System_Config_ReadonlyRenderer works.

The file ReadonlyRenderer.php exists within Package/Module/Block/System/Config too.

Whats going wrong here with this grouped class name?


texts: is there a way to override firegento-magesetup2/Plugin/Catalog/ListProductPlugin.php

texts: I just updated to latest magento2 but I have a Fatal Error which is related to this merge request https://github.com/firegento/firegento-magesetup2/pull/39/files and I would like to override without to make the changes in vendor. Is there a way to do this?


texts: How to add tag in dropdown menu to some selected categories

texts:
I'm using webandpeople extension to display my categories in dropdown list, i want to add some tags like new to some categories,
 plz provide me details how and where to add code to do it

this is display of my website

I want to display something like


texts: Magento 2 complicated shopping cart rule

texts:
I can't figure out how I can create a complicated cart discount rule I need and if it can be done.
Conditions for customers should be:

One specific brand called "Xbrand"
If customer add 2 products from "Xbrand" gets 10% discount
If a customer add more than 2 products from "Xbrand" gets 15% discount
Rule must be applied only to products from "Xbrand"
Must work if customer combines the "Xbrand" products with products from different brands

What I have done. I managed to solve first 3 steps with creating two different rules for cart. One for 2 products with 10% discount and one for more than 2 products with 15% discount.
My problem is when a customer combines "Xbrand" products with products from other brands. There my rules don't work.

My rule now is:
If ALL  of these conditions are TRUE :
If an item is FOUND  in the cart with ALL  of these conditions true:
Brand Name  is  Xbrand
Total Items Quantity  is  2

Get 10% discount. This works.
But if a customer add there a product from different brand rule breaks and don't give discount
Any help will be appreciated.