texts: Magento Site Layout Breaks Once a Day - Emptying Var/Cache Fixes

texts:
One of my client's websites on Magento 1.9.2.3 has been experiencing a strange error once every day (at random times).

Where the site is loaded without any graphical styling no images, no CSS, javascript or CMS Page content.

The site is only loading the header links (cart, account, login) Category navigational links (links to site product categories), and some footer links (advanced search, sitemap, etc.) - all in the default blue unordered list format. However, the site is loading static block content (although again without any styling, but the content is there).

On CMS pages, the follow error message also appears among the links:

"There was no 404 CMS page configured or found"

Each time this occurs, the site can be restored to normal upon deleting the contents of the var/cache directory - then the site loads perfect again... until it happens again.

I am including a screenshot of how the site loads below.

My best diagnosis of the error thus far has fallen on the LAYOUT_GENERAL_CACHE_TAG Magento cache as I have noticed that this showing invalidated when the site goes down like pictured above. It is almost like the site is having trouble loading CMS and theme content on occasion.

  A few notes on our setup:

  Dedicated cloud server
  4 Magento sites total (all on the same version & theme), but only one with this error
  No CDN in place

Any help is greatly appreciated, I am at my wits end trying to debug what is going on. It is such an easy fix to empty var/cache and bring the site to normal, but doing this everyday is getting overwhelming.

Thank you!

UPDATE:
After looking into the issue further, I noticed in the developer console in Chrome that the site is attempting to load js and css with the incorrect file paths.

For example: It is attempting to load css without the preceding "skin" directory and js without the preceding "js" directory. (i.e. https://domainname.com/frontend/base/default/css/style.css)

UPDATE 2:
I took another look at the rendered page when the site was down and it appears that the site is not loading any configuration properly when it goes down (no CMS content is being loaded on the page, the base urls for css & js filepaths are loaded incorrectly). Although every time the site breaks, a simple clearing of var/cache returns the site to normal.

  Notes on What I have Checked

  Correct File permissions for system files/folders
  Correct base secure & unsecure urls
  Correct base file paths for css and js
  Restarted Memcached
  Cleared Merged CSS & JS files
  No errors in layout.xml


texts: Configurable Product: Display Full Price for Options with Easylife Switcher

texts:
I am creating a website with Magento CE 1.9.1 and have installed the Easylife Switcher, which is working very well and does more or less what I want. The configurable options are set up to display as labels.

What I would like to add now are the prices for the options into the label as well.

As you may see in the attached image (first image) , the prices available under the select list for every option, however they are not included by the module when transforming the select list to labels.

Activating the configurable prices from the backend is no option however, since they only display the difference of price between the options.

My guess is that something needs to be done in the product.js for the Easylife Switcher (see second image), maybe create an "optPrice" like the "optText" that already exists - how to do that is however beyond me. this would be optimal as the Option Title and the Option Price could then be styled separately.

Would appreciate any help!

The HTML code:
Image 1 http://allblues.eu/skin/frontend/allblues/default/images/image1.png

Easylife Switcher's product.js:
Image 2 http://allblues.eu/skin/frontend/allblues/default/images/image2.png


texts: Send Money from Merchant's account to specified paypal email address programatically

texts:
I want to develop a feature like, transfer amount from merchant’s account to customer’s account.

Please refer below explanation.

Merchant set up PayPal settings on his store.

Now customer have to enter an email address to withdraw amount from client’s account. For this he have to enter an email address on specific page of site. After that when he click on “Withdraw amount” button, amount will be withdraw from merchant’s account to specified email address. This email address is associated with customer's PayPal account.

Is this possible ?


texts: Magento 1.9.3 call custom block in Payment Information

texts:
Am using magento 1.9.3 here how to call custom block in payment information section.

This is my custom block code:

app\design\frontend\{theme_name}\default\layout\epayment.xml

<?xml version="1.0"?>
<layout version="0.1.0">
  <epayment_index_index>
    <reference name="root">
      <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="content">
      <block type="epayment/index" name="epayment_index" template="epayment/index.phtml"/>
    </reference>
  </epayment_index_index>
</layout>

app\design\frontend\{thene_name}\default\template\epayment\index.phtml

    <?php
    $customer_details = Mage::getSingleton('core/session')->getEpayment();

    $checkout_email = Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getEmail();
    foreach($customer_details as $customer_detail)
    {
        $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
        $sql = "SELECT * FROM epayment WHERE customer_email='".$customer_detail['customer_email']."'";
        $rows = $connection->fetchRow($sql);

        if($customer_detail['customer_email'] == $checkout_email) {
?>

            <?php
            if(Mage::getSingleton('core/session')->getLeftAmount() == false){
                $collapse = 'collapse';
            ?>
                <input id="epayment" value="" type="checkbox" name="payment[method]" title="Payment By Your EPayment" class="pull-left" autocomplete="off" data-toggle="collapse" data-target="#demo">
            <?php
            } else {
            $collapse = 'in';
            ?>
                <input id="epayment" value="" type="checkbox" name="payment[method]" title="Payment By Your EPayment" class="pull-left" checked="" autocomplete="off" data-toggle="collapse" data-target="#demo">
            <?php } ?>
               Payment By EPayment

    <div class="panel-body <?php echo $collapse; ?>" id="demo">

                Value of your Order
                <input type="text" name="cart_amount" id="cart_amount" value="<?php echo round(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?>">

                Amount available in Wallet
                <input type="text" name="epayment_amount" id="epayment_amount" value="<?php echo  $rows['epayment_balance']; ?>">

Remaining:  will be carried in your wallet

                Left Amount To Be Pay
                <input type="text" name="left_amount" id="left_amount" value="">

<?php } } ?>

I have try this code in payment information section but not showing:

app\design\frontend\{theme_name}\default\template\checkout\onepage\payment\methods.phtml

<?php
  echo $this->getLayout()->createBlock('epayment/index')->setTemplate('epayment/index.phtml')->toHtml();
?>


texts:
Using Magento v1.9.2.3

I'm working on a simple cash register written in C# and using a barcode scanner.
We have already added the barcode as a new attribute to all our products.

I want to get all my products using the SOAPv2 API and save it in a local SQLite. When a barcode is scanned I can look in the database for the price. Seems simple enough.

I already figured out how to get the product data. First I use the catalogProductList to get a list of all my products. Next I use catalogProductList to get more details of a product, including the price.
Using catalogProductAttributeSetList I can get all my attribute sets. Next I can get all the attributes in a set using catalogProductAttributeSetList. Now I know the attribute_id of my barcode attribute. But I can't figure out how to get the value of that attribute in my product.

I did read this Get Custom attribute in API and I truly hope I don't need to mess with Magento and PHP to get this working.

Please let me know if I can read the value of my custom attribute without messing with Magento en PHP.


texts: Magento 2 How to get First Item from getList()?

texts:
I want to get only the first item from the SearchCriteriaBuilder result is there any method that gives direct first item?
currently using getList()->getItems() then for loop forget single item....
so I just want to know is there any shortcut method which gives the first record.....

class Promo extends \Magento\Framework\View\Element\Template{
    protected $sales_rule;
    protected $search_builder;
    public function __construct(Template\Context $context,\Magento\SalesRule\Api\RuleRepositoryInterface $sales_rule,\Magento\Framework\Api\SearchCriteriaBuilder $search_builder,array $data = array()){
        $this->sales_rule=$sales_rule;
        $this->search_builder=$search_builder;
        parent::__construct($context, $data);
    }
    public function getPromoDetail(){
        $sales_rule=array();
        $searchCriteria = $this->search_builder->addFilter('is_active',1,'eq')->addFilter('is_popup_rule',1,'eq')->create();
        $items = $this->sales_rule->getList($searchCriteria);
        foreach ($items->getItems() as $value) {
            $sales_rule[]=$value;
        }
        return $sales_rule[0]    ;

    }
}


texts: Generate Magento 2 Product Feed with MySQL Query

texts:
I hope you all having a nice day.

I am wondering is it possible to generate below feed with SQL on Magento 2 Database? I want to run this query from Google Apps scripts using jdbc:mysql.

Expected fields are:

----------------------------------------
| product_id | sku | name | categories |
----------------------------------------

I have tried this way but I don't know how to get product category names (including subcategories) not ids.

SELECT entity_id, GROUP_CONCAT(category_id) as category_ids FROM (
SELECT `e`.entity_id, `at_category_id`.`category_id`
FROM `catalog_product_entity` AS `e`
LEFT JOIN `catalog_category_product` AS `at_category_id`
ON (at_category_id.`product_id`=e.entity_id)
) sub_query
GROUP BY entity_id

Thanks :)


texts: Magento add Gst Charge Before Shipping Charge In checkout

texts:
I create one extension to add GST charge,
and i want to add charge before shipping Charge

i add code in config.xml like

<cgst_charge>
       <class>gstcharge/sales_quote_address_total_cgstcharge</class>
       <after>nominal</after>
       <before>grand_total</before>
</cgst_charge>

but it not work for me it show like

http://prntscr.com/hirio0


texts: Change Layout of Product List Filtered with Product Tag

texts: Where can I change the layout of the Product List Page filtered by the Product Tag. Currently My layout would be 3 columns but I want to change it to 2 columns left sidebar. How can I do it?


texts: Display Bundle Products in Category Listing When Bundle Options Not Set

texts:
I create new bundle product in magento without any bundle option selection.
I assign category,store and inventory same as simple product.
I check that product not display in category products listing.
If I create bundle option than it's display there.
I want to display all bundle products in category listing even if bundle option not set because of display product information in website.


texts: Product Star Ratings Summary not displaying Magento 1.9.0

texts:
Here is my  app/design/frontend/rwd/ysv/template/rating/detailed.php

<?php if(!empty($collection) && $collection->getSize()): ?>

        <col width="1" />
        <col />

            <?php foreach ($collection as $_rating): ?>
                <?php if($_rating->getSummary()): ?>

                        <?php echo $this->__($this->escapeHtml($_rating->getRatingCode())) ?>

                                <div class="rating" style="width:<?php echo ceil($_rating->getSummary()) ?>%;">

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

<?php endif; ?>

app/design/frontend/rwd/ysv/template/review/product/view/list.phtml

Is there any error or any line is missing.

<?php $_items = $this->getReviewsCollection()->getItems();?>

    <?php if (count($_items)):?>

                <?php echo $this->__('Customer Reviews') ?>
                <?php echo count($_items); ?> item(s)

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

        <?php foreach ($_items as $_review):?>

                <a href="<?php echo $this->getReviewUrl($_review->getId()) ?>">
                    <?php echo $this->escapeHtml($_review->getTitle()) ?>

                <?php $_votes = $_review->getRatingVotes(); ?>

                <?php echo nl2br($this->escapeHtml($_review->getDetail())) ?>

                <?php if (count($_votes)): ?>

                    <col width="1" />
                    <col />

                        <?php foreach ($_votes as $_vote): ?>

                            <?php echo $this->escapeHtml($_vote->getRatingCode()) ?>

                                    <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;">

                        <?php endforeach; ?>

                <?php endif; ?>

                    <?php echo $this->__('Review by %s', $this->escapeHtml($_review->getNickname())) ?>
                    /
                   <?php echo $this->__('(Posted on %s)', $this->formatDate($_review->getCreatedAt()), 'long') ?>

        <?php endforeach; ?>

        <?php // echo $this->getChildHtml('toolbar') ?>
    <?php elseif($this->getParentBlock()): ?>
        <?php echo $this->getParentBlock()->getReviewsSummaryHtml($this->getProduct(), 'short', true)?>
    <?php endif;?>
    <?php echo $this->getChildHtml('review_form') ?>

UPDATE:
this gives the value like

Quality : 2
Price : 3
Value : 1

But i want to print star.

should i hard code this.

$this->escapeHtml($_vote->getValue())


texts: How to make shipping address default like magento in Magento 2?

texts:
I am using porto theme in magento 2 and on shipping address for logged in user who save the shipping address on edit the address it gives me popup to edit that like

I want to same like magento default not in popup
Any help is appriciated


texts:
We have a site where the client needs a number of customers to have an account specific price. For this, we've used customer groups. The accounts, products, and pricing are all updated via an API - if an account price is specified then we create a customer group dynamically and then store the group_price on it.

The issue we have is that Magento's catalog_product_price_index table stores a price for every product, customer group, and website ID in it (even if no group pricing exists). Presumably this is so that Magento only has to do a single look up to the price table which makes sense however this table is now massive and takes ages to create.

My immediate thought is that we rewrite the indexer so that:

The NOT LOGGED IN customer group always has a row stored in the price index
Any customer groups that have a group price specified for a product are stored in the price index

We would then modify the product so that it would look for the customer group price and fallback to the NOT LOGGED IN price if none was found.


texts: Getting "Fatal error" in adding a customer attribute

texts:
Currently I am trying to add a customer attribute but getting the following error:

  Fatal error: Class 'XXXXX_CustomerField_Model_Entity_Setup' not found
  in /app/code/core/Mage/Core/Model/Resource/Setup.php on line 234 Call
  Stack

Here is my module: local/XXXX/CustomerField/etc/config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <XXXX_CustomerField>
            <version>0.1.0</version>
        </XXXX_CustomerField>
    </modules>
    <global>
        <models>
            <XXXX_CustomerField>
                <class>Napit_CustomerField_Model</class>
            </XXXX_CustomerField>
        </models>
        <resources>
            <customerfield_setup>
                <setup>
                    <module>XXXX_CustomerField</module>
                <class>XXXX_CustomerField_Model_Resource_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </customerfield_setup>
        </resources>
        <fieldsets>
       <checkout_onepage_quote>
         <customer_membership_no>
             <to_customer>membership_no</to_customer>
         </customer_membership_no>
       </checkout_onepage_quote>
        <customer_account>
            <membership_no>
                <to_quote>customer_membership_no</to_quote>
            </membership_no>
        </customer_account>
      </fieldsets>
    </global>
</config>

local/XXXX/CustomerField/Model/Resource/Setup.php

<?php
class XXXX_CustomerField_Model_Resource_Setup extends Mage_Customer_Model_Entity_Setup
{
    public function getDefaultEntities()
    {

        return array(

            'membership_no'=>array(
                    'type'=> 'static',
                    'label'=> 'Membership Number',
                    'visiable' => true,
                    'required' => false,
                    'sort_order' => 80,
            ),
        );
    }
}

and local/XXXX/CustomerField/sql/customerfield_setup/install-0.1.0.php

<?php

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

$installer->addAttribute('customer', 'membership_no', array(
    'label' => 'Membership Number',
    'visible' => 1,
    'required' => 0,
    'position' => 1,
    'sort_order' => 80,
));

$installer->endSetup();

$customer = Mage::getModel('customer/attribute')->loadByCode('customer', 'membership_no');
$forms= array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register');
$customer->setData('used_in_forms', $forms);
$customer->save();

Thanks

***** EDIT *****

So my problem was the folder path of was entity/setup where as it was calling resource/setup, I've made the amends now getting another error:

  Fatal error: Call to a member function getColumns() on a non-object
  in lib/Varien/Db/Adapter/Pdo/Mysql.php on line 2201


texts: Configurable product still displayed but accosiated simple product is out of stock

texts:
I have a configurable product with 2 simple accosiated products (size 41,42).
Two simple product is out of stock but when i enter product page of configurable product i see that has two available option 41 and 42. If i select one of this option and then press add to cart button i get a message such "This product is currently out of stock"

I have check catalog /inventory settings (manage stock, backorder and set out of stock if qnt = 0).

Also i have decache and reindex

Now i use magento 1.9. I think that with 1.7 i havent this problem.

Any idea?


texts: Remove annoying calculate button from Magento 2 Bundle Page layout

texts:
I have set up a bundle product and its working but can I disable the javascript that forces me to click on calculate every time I use it?

I want it to open in "calculate mode". I dont know what Im doing wrong. is it bundle.js or slide.js?


texts: Update gift message after order success in magento 1.9

texts:
gift message
this link working fine for me, Now I want to update my Payment Method Name into Gift message field in sales order in admin side area, that Means if I have checkmo payment method , then update this into Gift message field into admin side area.


texts: Rewrite Block Class that is rewriting Mage Core Class

texts:
I'm trying to override a Block class called Smartwave_Megamenu_Block_Topmenu, which is declared like the following:

    <blocks>
        <catalog>
            <rewrite>
                <navigation>Smartwave_Megamenu_Block_Navigation</navigation>
                <!-- v1.4-1.6 -->
            </rewrite>
        </catalog>
        <page>
            <rewrite>
                <html_topmenu>Smartwave_Megamenu_Block_Topmenu</html_topmenu>
                <!-- v1.7 -->
            </rewrite>
        </page>
        <megamenu>
            <class>Smartwave_Megamenu_Block</class>
        </megamenu>
    </blocks>

As you can see this config.xml-Block node is rewriting html_topmenu of Mage_Core.

However, if I try to rewrite megamenu like the following:

    <blocks>
        <vendor_template>
            <class>Vendor_Template_Block</class>
        </vendor_template>
        <megamenu>
            <rewrite>
                <topmenu>Vendor_Template_Block_Topmenu</topmenu>
            </rewrite>
        </megamenu>
    </blocks>

The same old Class is still loaded. Why is this happening and how can I rewrite this Block Class properly?

I've cleared caches, of course.


texts: How to run commands without having access to shell

texts:
I am customizing a Magento 2 theme, I am a little bit confused that after changing anything in coding or changes in CSS I have to run some command as suggested

For this each time I have to ask system administrator to run the command as I have no access to shell

like php bin/magento setup:static-content:deploy command

Is there any other way to do the same.


texts: Magento 2.1 Theme option not available in Store > Configuration > General > Design

texts: I installed Magento 2.1 successfully.But When I go Store > Configuration > Design,theme option not avaiable.I tried pub deploy and flush cache and reindex command but theme option not available in Magento 2.1.


texts: Error page when placing order, otherwise order is normal

texts:
We have a magento 1.7 site that's been up for ~3 weeks now. It handles ~100 or so purchases a day using Authorize.net and PayPal Express. About 1 in 50 customers get an error page saying the order cannot be completed (or something to that effect) even though the order is created and the payment is processed normally. It's happening with both PayPal and Authorize.net. Other than the user seeing the error page (and usually placing the order again thereby getting charged twice) everything about the order looks normal.

I've been all over the logs (magento and apache) and can't find any suspicious entries that correlate to the time the "erred" order was placed. Been trying to track this down for days now.

Any suggestions would be extremely appreciated.


texts: Magento 2.3 Add image field in serilaized

texts:
I need to add image field here.
Any help will be appreciated.


texts: Open Mass action Url in New Tab in the Admin grids

texts:
Is this Possible to Open Mass Action target url with submitted data in New tab or Window in Magento. I have tried and searched for this but not find any solution.

$this->getMassactionBlock()->addItem('id', array(
             'label'=> Mage::helper('sales')->__('Label'),
             'url'  => $this->getUrl('url'),
        ));

Thanks


texts: No Search after Activate flat products / categories

texts:
i activated the Options "flat products" and "flat categories" to speed up my shop. Now my search function is not working anymore on 1 from 2 store views, i get redirected to home when klicking on a search result.

On the other view, the search function still works...

I already did follow the following steps:

1) Reindex
2) Clean Cache
3) Check the Attributes & Search Options (Still ok because the options did not change)

When i deactivate flat options and reindex, all work fine :(

Please help.
Chris


texts: Getting infinite loop on loading category pages

texts:
After I put my magento project on a linux server. I cleared all of cache. I removed all of the files from var/cache.  I used this command

php -indexer --reindexall

everything was reindexed successfully. I even truncate the core_url_rewrite and did a new reindex all, BUT I still cannot access the subcategory urls. The category url I can access.

It might be worth to mention subcategories are actually a category + Amasty layered navigation filters in the URL

I selected NO for the Use Web Server Rewrites input, but still i get the infinite loop. So why do i get the infinite loop (for page loading) for subcategory urls ? Thx in advance !


texts: Magento2: position in category in product's list.phtml

texts:
Magento can sort products by a manually set position in a category. When I echo the select of a collection (echo $productCollection->getSelect()) it shows as cat_index`.`position` AS `cat_index_position in the query.

But the products in the resulting list do not contain this position. How could I get it into the product list?

Thank you


texts: How to get collection of all the widgets created in admin panel?

texts:
In admin panel, I create a widget by choosing it's Type, Design Theme  and applying the custom widget options. I have not selected any Layout Updates for that widget.

Let's say I have created ten widgets of the same type in the above mentioned way. Now I want to retrieve this collection of widgets and get their custom options. Is there any way to do it?

Refer this link for images.


texts: I have installed a theme for my Magento go store and added some my own customizations to it, now is it possible that I can have whole theme packaged as one, so I can use it as it base theme for my other  projects/


texts: How to import tier prices using CSV?is there any script or extension available for that?


texts:
By default clicking breadcrumbs Home will go to home page.
How can I change the URL for home link to be different than store home page?
For Magento 2.1.


texts: Custom Form with not sending emails from frontend:Unable to send email. Sample of a custom notification error from Contact Us Form

texts:
I have following email controller in my custom module not sending emails. when I print the $params arrays it giving the output not email is not sending. Please check and let me know what is wrong with this

public function sendemailAction()
{       $params = $this->getRequest()->getParams();
        print_r($params);

        $body = '
Contact Form

Hello,

We have received this message from the website:

Name: ' . ($params['name']) . '

Email: ' . ($params['email']) . '

        Comments: ' . ($params['comment']) . '
';
        $mail = new Zend_Mail();
        $mail->setBodyHtml($body);
        $mail->setFrom($params['email'], $params['name']);
        $mail->addTo('test@test.com');
        $mail->setSubject('Contact Form');

        try {

            $mail->send();

        }

            catch(Exception $ex)

        {
        Mage::getSingleton('core/session')->addError('Unable to send email. Sample of a custom notification error from Contact Us Form.');

        }           $this->_redirect('reviews/');

    }


texts: How to add wrapper in checkout page in magento 2?

texts:
I want to add container div and add Shipping address and Order summary in it as below design.
How can i do that?

Thanks.


texts: I want to apply a limit for discount amount on checkout. I am providing multiple discount to my customer what I want whenever customer checkout the maximum discount limit will be 50% of the order amount on checkout.


texts: Product Listing Images Are Not Displaying/Loading Correctly

texts:
Website is on Magento 2.2.6. As far as I remember, this issue was not present when we were on previous versions of Magento.

Description of the issue:

When clicking on a product listing, the resulting product page will load just fine, except for the image.

All you can see is the top 1px of the height of the image. The width seems to be the correct size.

Clicking on any of the size/color attributes will change the photo, but it will still not load completely. You can tell the photo changes if you look closely at the 1px height that is visible.

The only way to get the photo to load in correctly is to refresh the page.

After the page is cached, you can revisit the same page which had an issue, and the photos will now load properly with no need to refresh.

This seems to happen more often when you click on the product listing and open it in the same tab. If you CTRL-Click and open the listing in a new tab, more often than not, it will load just fine.

Although caching temporarily solves the issue, the issue would still be present for any new visitors to the website.

The theme that the website is using is Unero.

I have tried multiple solutions, to no avail.

I have merged css/js files and deployed, then flushed the cache, but the issue still persists.


texts: Magento appending '-1' in Category URL Key in frontend

texts:
Magento is appending '-1' only to certain categories URL key despite not being defined by us like that in backend.

Eg. if URL key for category 'sample' is 'sample' .. in frontend its showing as '/sample-1'

its not the case with all categories but 2 or 3 that too in desktop version alone.its working fine in mobile version

what could be the issue?

can anyone help ASAP?


texts: Having an issue with multisite where I edit css for each store to set image widths and height, for some reason the css isn't updating on certain sites. One of them took effect after clearing css/js cache in Cache Management, however the others are not. I have manually purged var/cache folder and cannot figure out why these other css files are not being updated on the frontend. Any help would be greatly appreciated.


texts: It's seems Malware script added to the gtm.js coming from the https://www.googletagmanager.com/

texts:
We are using google tag manager script on Magento2 website and when we scan website in Magento Security Scan tool, it's throwing error with "Malware Detected" because of google tag manager script.
See this detail reply from Magento Security Team:
https://www.googletagmanager.com/gtm.js?id=GTM-5VHWP57
"In addition to having a signs of malware and referencing the googleadwordswidget.com which has been proved to be a malware hosting, the script hides itself and is not visible neither in the code inspector nor in the page’s source body which proofs that the script developers put a lot of effort in order no one found their script."
We have the following system configuration:
Magento - v2.4
PHP        - v7.4
Web Server - Nginx


texts: Magento 2.1 position in layout XML changes position in generated HTML

texts:
I'm trying to understand Magento's html building process.
Currently I'm stuck at this file:
https://github.com/magento/magento2/blob/develop/app/code/Magento/Theme/view/frontend/layout/default.xml

Here in line 19 you will find this:

   <referenceBlock name="top.links">
        <block class="Magento\Theme\Block\Html\Header" name="header" as="header" before="-">
            <arguments>
                <argument name="show_part" xsi:type="string">welcome</argument>
            </arguments>
        </block>
    </referenceBlock>

And this at line 33:

<referenceContainer name="header.container">
        ...
                <!-- line 43 below -->
                <block class="Magento\Framework\View\Element\Html\Links" name="top.links">
                    <arguments>
                        <argument name="css_class" xsi:type="string">header links</argument>
                    </arguments>
                </block>

As far as I get this does the following:

it will create an "ul" element (due to the code in the class Links) referenced as "top.links" with css classes "header links"
it will add a "header" element referenced as "header" at the top
(because of the before) of the ul-Element that is referenced as
"top.links"

Stuff in those top links is added elsewhere, like in the customer module

What I don't get is this:
if I cut the first block <referenceBlock name="top.links">... starting from line 19 to line 25 and paste it below the code in line 33, say below line 58.
Why does the generated element in the html output also move somewhere else and will not be generated at the top of the container but at the bottom?


texts: Show subcategories in a parent category Magento2.1

texts:
Does anyone have an idea how to show a list of subcategories with a link and image on a parent category.

So when I click a parent category to show all subcategories including the one in the third subcategory.

It's maybe good to mention that I also have created a static block for that.

I found some tutorials including this one on how to add a list of subcategories on a category page but these are all for magento 1.x I need it to be for magento 2.1.

I need a step by step tutorial, please.


texts: how to search dropdown list with URL values without page refresh using javascript?

texts:
i want to search dropdown list values without page refreshing. following code is working fine. when i select dropdown option it is redirect to related url value. but my requirement is when i select dropdown option and click on submit button then related url will search without page refresh.

code

<select name="menu1" id="menu1">
<option value="">Select your choice...</option>
<option value="https://free.greenhouse.com/tree/list/cucumber">Cucumber</option>
<option value="https://free.greenhouse.com/tree/list/tulasi">Tulasi</option>
<option value="https://free.greenhouse.com/tree/amond">Amond</option>
<option value="https://free.greenhouse.com/tree/list/awala">Awala</option>
</select>
</br></br>
<script type="text/javascript">
 var urlmenu = document.getElementById( 'menu1' );
 urlmenu.onchange = function() {
  window.open( this.options[ this.selectedIndex ].value,"_self" );
 };
</script>


texts: Magento 2 : Coupon Code for Child of Configurable Product

texts:
I have configurable product. It has sizes of bottles like 4oz, 16oz, 32oz, Gallon. I want to apply coupon code that works on 16oz.

I add 16 oz bottle to my cart, and if I just apply coupon to items in that category then it will work, but it will do it also for 32oz bottles. If I add condition to be "Bottle Size" (configured attribute) is equal to "16 oz". Then coupon just always fails.

The only error on cart is:

The coupon code "testcoupon" is not valid.

I assume, it's not able to recognize simple item  which is selected that matches 16 oz attribute, configurable item doesn't have the attribute and even if it's selected in cart it's not recognized by coupon system.

Most items I have with attributes are set that way for configurable items, but I have just a couple that are set and there is no configuration. For these coupon seems to work because attribute is defined. But unless this works for configurable items it makes configurable items kind of unusable.


texts: magento 2 Remove product specific image programmatically not all the gallery images?

texts:
I am updating the product from the frontend and I want to only remove specific images which client is deleted not all the images.

Is there any method available ?

help will be appreciated.


texts: restore the default checkout in magento 2.3

texts:
I have a disaster in the template of a checkout, it is really bad!. I never used Magento but now I need to restore the default checkout layout/html/template of a web.

I no have backups of changes and really I don't know where to start modifying files. I search in module-checkout but I really don't know how to do it.

I have in other server a fresh installation of Magento 2.3 so I can copy-paste files but i don't know what files I need to copy-paste.

All the other things in the web are Okay, only the visual of Checkout are broken.

Thanks


texts: Magento 2: Update Cart "Invalid Address Id"

texts:
When i try to update card from my account. It says below error message.

https://github.com/magento/magento2/issues/7570

Due to that my DHL International Shipping is not showing Shipping rates.


texts: Logo and images not shown in gmail accounts magento 2

texts:
I getting issue about for displaying images and logo in gmail account when i send email to customers through magento2 then logo and images are not shown why because of the reason I search a lot to find out the solution still not getting anything to resolved for it, please help me out of this issue.

Thanks in advance.


texts: Magento Customer Reports only showing 5 results per day

texts:
The reporting functions are a mess. I love the flexibility of Magento but some things are really bad.

I want to create a ranking list of our best customers. However the Magento Customer Report only shows a maximum of 5 orders per day. This seems to be a rule set by the system but I can't find where to change it. Statistics are refreshed.

I'm running Magento 1.8.1.0 without any order report extensions installed.

Does anyone know why the report is limited to 5 entries and how to change it?


texts: checkout_cart_add_product_complete get quote item

texts:
I'm trying to perform an action after i add a product to my cart.

I tried the observer
checkout_cart_product_add_after
but this does not enter a new line in the quote until after, thus my quote item is empty.

I need to have the line item created for the quote.

So i thought i would use "checkout_cart_add_product_complete" and this does create a line item in the quote, but i don't know what the new line item entity_id is from the "checkout_cart_add_product_complete", i tried looking at the object but it is way to big for me to find it....

Anyway so all i want after adding a product to the cart, is get the new line item id, this DOES NOT have to be from my observer object if not possible...


texts: Today, can I safely use CSS Flexbox and Grid in order to develop my Magento theme?

texts:
Today (April 2021), can I safely use these new CSS property in order to develop my Magento theme?

Flexbox
Grid

Or should I still prefer Float and Inline-Block?
This is my audience:


texts:
I tried to upgrade to M 2.1.3 and was unsuccessful and found update was stuck in a loop repeating these lines below over and over. Does anyone have any ideas of what might be causing this?

The stack trace of the looping process showed the following constantly repeating:

stat("/chroot/home/babywitc/babywit.com/html/var/cache/mage--5/mage--
-516_Zend_LocaleC_en_US_currencynumber_", {st_mode=S_IFREG|0660, st_size=128, ...}) = 0

lstat("/chroot/home/babywitc/babywit.com/html/var/cache/mage--5/mage---516_Zend_LocaleC_en_US_currencynumber_", {st_mode=S_IFREG|0660, st_size=128, ...}) = 0

lstat("/chroot/home/babywitc/babywit.com/html/var/cache/mage--5",

{st_mode=S_IFDIR|0777, st_size=45056, ...}) = 0
open("/chroot/home/babywitc/babywit.com/html/var/cache/mage--5/mage--
-516_Zend_LocaleC_en_US_currencynumber_", O_RDONLY) = 11

fstat(11, {st_mode=S_IFREG|0660, st_size=128, ...}) = 0
lseek(11, 0, SEEK_CUR)                  = 0
flock(11, LOCK_SH)                      = 0

read(11, "a:4:{s:4:\"hash\";s:0:\"\";s:5:\"mtim"..., 8192) = 128
fstat(11, {st_mode=S_IFREG|0660, st_size=128, ...}) = 0
read(11, "", 8192)                      = 0
read(11, "", 8192)                      = 0
flock(11, LOCK_UN)                      = 0
close(11)                               = 0

stat("/chroot/home/babywitc/babywit.com/html/var/cache/mage--7/mage--
-516_Zend_LocaleL_en_US_symbols_", {st_mode=S_IFREG|0660, st_size=329, ...}) = 0

lstat("/chroot/home/babywitc/babywit.com/html/var/cache/mage--7/mage-

-516_Zend_LocaleL_en_US_symbols_", {st_mode=S_IFREG|0660, st_size=329, ...}) = 0
lstat("/chroot/home/babywitc/babywit.com/html/var/cache/mage--7",

{st_mode=S_IFDIR|0777, st_size=45056, ...}) = 0

open("/chroot/home/babywitc/babywit.com/html/var/cache/mage--7/mage--
-516_Zend_LocaleL_en_US_symbols_", O_RDONLY) = 11

fstat(11, {st_mode=S_IFREG|0660, st_size=329, ...}) = 0
lseek(11, 0, SEEK_CUR)                  = 0
flock(11, LOCK_SH)                      = 0
read(11, "a:4:{s:4:\"hash\";s:0:\"\";s:5:\"mtim"..., 8192) = 329
fstat(11, {st_mode=S_IFREG|0660, st_size=329, ...}) = 0
read(11, "", 8192)                      = 0
read(11, "", 8192)                      = 0
flock(11, LOCK_UN)                      = 0
close(11)                               = 0


texts: Magento ver. 1.9.2.1 admin menus unclickable

texts: I have installed Magento ver. 1.9.2.1 recently on my vps and after logging into admin panel I found out the menu bar links are unclickable and submit buttons such as in index management also not working.I reset the file permisions to 700 for directories & 600 for files but still the problem persists.Please help.


texts: Magento export order in csv price symbol â‚¹ . How to change into rupees symbol


texts:
I am trying to add what will become a slider into the administration area. I have an input box showing (that will eventually hold the slider value) by creating a new attribute in my install script:

$installer->addAttribute(
    'catalog_category',
    'my_custom_attr',
    array(
        'label' => 'My Custom Attribute',
        'group' => 'My Group',
        'type'  => 'int',
        'class' => 'validate-number',
        'required' => false,
        'default' => 50,
        'renderer' => 'mymodule/adminhtml_catalog_category_widget_slider'
    )
);

I need to add some html after the input field has been rendered, so I created this class:

class Mynamespace_Mymodule_Block_Adminhtml_Catalog_Category_Widget_Slider extends Varien_Data_Form_Element_Text
{
    public function getAfterElementHtml()
    {

        $html = parent::getAfterElementHtml();
        return $html."

";
    }
}

The above class resides in app/code/local/Mynamespace/Mymodule/Block/Adminhtml/Catalog/Category/Widget/Slider.php so should be getting called no problem but no extra HTML is getting added.


texts: Copied to Local WAMP server, Exception: SQLSTATE[HY000] [1045] Access denied for user

texts:
So I had a website up at http://www.avantalarm.com/ and after many issues trying to add modules, I decided I'd export it to a local WAMP server to work on my development so I didn't break the site while trying to figure things out.  I am very new to Magento and figured this would be the best way to do it.  After exporting it to my WAMP server via FTP, I noticed that when trying to log into Admin or open the home page I get

There has been an error processing your request

Exception printing is disabled by default for security reasons.

Error log record number: 1489781624

Looking at the error report in var/report/ reveals this code.

a:5:{i:0;s:96:"SQLSTATE[HY000] [1045] Access denied for user 'avant_jonathan'@'localhost' (using password: YES)";i:1;s:1302:"#0 C:\wamp\www\includes\src\__default.php(53987): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\wamp\www\includes\src\__default.php(54460): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 C:\wamp\www\includes\src\__default.php(52674): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 C:\wamp\www\includes\src\__default.php(53730): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 C:\wamp\www\includes\src\__default.php(54566): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 C:\wamp\www\includes\src\__default.php(29302): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 C:\wamp\www\includes\src\__default.php(29243): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 C:\wamp\www\includes\src\Mage_Core_Model_Resource_Setup.php(141): Mage_Core_Model_Resource->getConnection('core_setup')
#8 C:\wamp\www\includes\src\Mage_Core_Model_Resource_Setup.php(234): Mage_Core_Model_Resource_Setup->__construct('core_setup')
#9 C:\wamp\www\includes\src\__default.php(20124): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#10 C:\wamp\www\includes\src\__default.php(20050): Mage_Core_Model_App->_initModules()
#11 C:\wamp\www\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#12 C:\wamp\www\index.php(87): Mage::run('', 'store')
#13 {main}";s:3:"url";s:6:"/admin";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I wonder if either a) older files or modules from my old WAMP server are causing the error or b) not all the files copied over correctly.  If anyone can help and even possibly help me understand how to read this report, that would be much appreciated.  This is also one of my first few questions on StackExchange so if I can reword or add more to my question let me know, I'm excited to learn how to be a contributing member here as I know it will be a valuable resource.

Thanks in advance!


texts: Show a selected amount of simple products on configurable

texts:
At the moment I am showing associated simple products on a tab on the configurable product which works perfectly with the following code:

if($_product->getTypeId() == "configurable"): ?>
<?php $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); ?>
<?php $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions()->addAttributeToSort('Price', 'asc'); ?>

I then echo about 3 pieces of information from the simple products like:

<?php echo Mage::helper('core')->currency($simple_product->getPrice()) ?>

this is contained inside a table and that is the reason I am dropping in and out of php.

What I want to do now is limit the amount of simple products that is displayed to about 5 as in some cases there are over 20.

I then want a link/button saying show more which will show the remaining products if the person wishes to do so.

Thank you :)


texts: Custom options clearing out during product save

texts:
We are experiencing a very strange issue with a Magento 1.9.3 site that I have never seen before.

The gist of it is: All required drop-down custom options on simple products are getting cleared out on a somewhat regular basis.

Already ruled out automated imports and other automation
Already ruled out dev scripts on the site
The site is scanned regularly and has a WAF in front of it for access – so unlikely that we are dealing with malicious actors
It seems to be somewhat related to product adding/editing in the admin

When it happens – the SKU column in the custom option line has the most recent product SKU for all items and the name column is blanked out.

Has anyone seen anything like this before?


texts:
This is my array

    $_tierPrices = Array
     (
    Array
        (
            "price_qty" => "4",
            "price" => "143.00",
            "savePercent" => "8"
        ),

    Array
        (
            "price_qty" => "12",
            "price" => "133.0000",
            "savePercent" => "15"
        ),

    Array
        (
            "price_qty" => "20",
            "savePercent" => "18",
            "price" => "128.0000"
        ),

    Array
        (
            "price_qty" => "40",
            "savePercent" => "21",
            "price" => "123.0000"
        )
     );

I want to set this array value in table format as shown below:

Please advice


texts: Installing magento2 ina subdirectory give me eternal loops in the admin

texts:
How can I have magento2 in a subdirectory in a reseller with cpanel.
I have the domain pointing public_html but my magento instance have to be in public_html/src
I put the following code in the .htaccess at public_html:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !(.*)src
RewriteRule ^(.*)$ src/$1 [L]

The front end works fine but the admin (/superadmin) generate a loop:
https://subdomain.domain.com/superadmin/admin/superadmin/admin/index/index/key/bc04c725b37663ece6006c4eb7
I also tryed:
# RewriteEngine on
# RewriteCond %{HTTP_HOST} ^(www.)?subdomain.domain.com$
# RewriteCond %{REQUEST_URI} !^/src/
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ /src/$1
# RewriteCond %{HTTP_HOST} ^(www.)?subdomain.domain.com$
# RewriteRule ^(/)?$ src/ [L]

In the core_config_data I have https:/subdomain.domain.com/ at secure and insegure
I am not sure what it is wrong maybe that this htaccess only work without having a subdomain in the url.
I cleared browser cache, delete magento folders, change browsers and ask my grand mother to run the site from her xt386 but not luck.


texts: How to submit a CSV file in admin and how read it in Magento2?

texts: How to submit  a CSV file in admin side  and how read it in Magento2?


texts: Magento 2 - Marketing Conversion Tag Troubleshooting

texts:
I work at an agency with a client trying to put a conversion code with dynamic parameters into the purchase success page. The code requires Magento 2's unique identifiers to create the hit that relays the info to my ad platform. I need the parameters for: cart subtotal and for product name.
As example, Shopify uses {{checkout.subtotal_price}} for subtotal values.
Can anyone reply with these values?


texts: Magento2 : Product not saving set custom attribute using Observer

texts:
I want to set Discount on my product after Save product so I'm using catalog_product_save_after then I am  creating an attribute 'discount' and set the calculated value, but when i save the collection it not working properly ('stuck & looping admin panel loader'). How can i solve this issue ?

namespace Wac\SortDiscount\Observer\Catalog;

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class ProductSaveAfter implements ObserverInterface
{

    public function execute(Observer $observer)
    {
        $product = $observer->getProduct();
        $orgprice = $product->getPrice();
        $specialprice = $product->getSpecialPrice();
        $product->setDiscount($orgprice - $specialprice);
        // die($specialprice);
        $product->save();
    }
}

Thanks


texts: Configurable Product Option appears in drop down even though it is out of stock

texts:
No matter what I try, in one of my store views, all product options are appearing in the drop down menu, even though all but one are sold out (only Size UK 10 should be available. All others have quantity 0 and are marked Out of Stock).

On other store views, it appears correctly:

As you can see, the product is out of stock on the magento back end:

Here is an example of one of the simple products:

I've tried looking to see if there is a discrepancy between the different store views, but can't see anything. Does anyone have any ideas of what I can try?

(Running 1.7.0.2 Magento CE)


texts: Currency switcher isn't working properly

texts:
I used custom theme by Plazma theme in my magento website,
in home page when i select currency from header it changes and rates and only in few sections,

For example, there are three sliders available in home page,
      1). Sale Off
      2). Featured Products
      3). New Products

when i select currency it changes rates of products only in Sale off slider, remaining slider remains unchanged.

I noticed weird issue that is when open any product, and in product view page and category listing page it converts currency rates.
Only issues in home page.
i flushed all caches, but no luck

Any help would be appreciate.


texts: How to map a dynamic url to a function in controller

texts:
I'm creating a new magento module. The frontend name of the module is groupedproduct. Now i need to map a dynamic url to indexAction of the IndexController. For example the url will of the form http://localhost/magento/groupedproducts/subcat1 This url will be dynamic for example http://localhost/magento/groupedproducts/subcat2, http://localhost/magento/groupedproducts/subcat3 I want to redirect all this url to http://localhost/magento/groupedproducts/index/index.

I tried using .htaccess file and added following redirect rule

Options +FollowSymLinks
RewriteEngine on
RewriteBase /magento/
RewriteRule ^groupedproducts/(.*)$ index.php/groupedproducts/index [NC]

But it not working. I have checked and confirmed that the .htaccess and mod_rewrite are working by adding simple rewrite rule to a php file.


texts: All Observer event calling one method! Confused!

texts:
Calling EventObserver $observer->getEvent() multiple times.

I am using a single execute(EventObserver $observer) to call

$product = $observer->getEvent()->getProduct();
$productdel = $observer->getEvent()->getProduct();
$payment = $observer->getEvent()->getPayment();
$this->productUpdate($product);    //catalog_product_save_after event
$this->saleOrderComplete($payment);   //sales_order_payment_place_end event calling productUpdate()
$this->productDelete($productdel);   //catalog_product_delete_after event calling productUpdate() why?

All my other events seem to call same function.

Why?


texts:
I am using Magento-2.1.5, and I want to auto-generated mail as in response to the customer after successfully submitting the contact us form.

Can anyone please tell how to do that

if I will use this code in Phtml file, will it work: or I have to do something else???

<?php
if(isset($_POST['submit'])){
$to = "email"; // this is cuatomer Email address
$from = $_POST['email']; // this is the sender's Email address
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$subject = "Form submission";
$subject2 = "Copy of your form submission";
$message = $first_name . " " . $last_name . " wrote the following:" . "\n\n" . $_POST['message'];
$message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];

$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
// You can also use header('Location: thank_you.php'); to redirect to another page.
}
?>


texts: Magento 2 checkout postcode validation only numbers

texts:
Magento 2 in checkout page postcode, I want to restrict alphabets allowed only numbers, how can I set by using a validation XML file?

I tried below link for postcode validation number

<item name="postcode" xsi:type="array">
     <!-- post-code field has custom UI component -->
     <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
     <item name="validation" xsi:type="array">
      <item name="required-entry" xsi:type="string">true</item>
      <item name="validate-number" xsi:type="number">0</item>
    </item>
    </item>

Please help me


texts:
im importing a large csv programmatically and i want to save product length width height and didn't found any post related to this, so:

I tried to:

$product->setCustomAttribute('width',(int)$data[22]);
$product->setCustomAttribute('ts_dimensions_width',(int)$data[22]);

from product attributes

$product->setData('lenght',$data[21]);

Any of these more logical ways didn't work.
any ideas?
thanks!


texts: Magento 2 Rest API Returning Net::HTTPRetriableError: 302 "Found"

texts:
I am trying get access token & access secret but when i try to connect to magento2 rest API i am getting this error, I have tried multiple endpoints urls like rest/V1/, rest/all/V1/ etc but still get Net::HTTPRetriableError: 302 "Found"

Here is the code i am using to access the token

REQUEST_URL = '/oauth/token/request'
ACCESS_URL = '/oauth/token/access'

OAuth::Consumer.new(consumer_key, consumer_secret, site: site, request_token_path: REQUEST_URL, access_token_path: ACCESS_URL)

Can you please advice as to what could be the issue. Thanks.


texts: Magento 2 - find out if text is from static block

texts:
I try to replace the footer with my own, but I have no clue how.

I activated template hints, but it does not show any hint if this is a static block.

How can I modify this ?


texts: Error SQLSTATE[42S22]: Column not found: 1054 Unknown column => when level 2 categories clicked

texts:
I have 4 levels of category tree. After I've spent some hours setting up SEO, Sitemap and other stuff in Admin panel and Google developers account, something went wrong and 2nd levels categories not showing.

Other links and categories works perfect...

The record is below (sorry for its size):

a:5:{i:0;s:785:"SQLSTATE[42S22]: Column not found: 1054 Unknown
   column 'main_table.thumbnail' in 'field list', query was: SELECT
   `main_table`.`entity_id`, `main_table`.`level`, `main_table`.`path`,
   `main_table`.`position`, `main_table`.`is_active`,
   `main_table`.`is_anchor`, `main_table`.`name`, `main_table`.`image`,
   `main_table`.`thumbnail`, `main_table`.`is_anchor`,
   `url_rewrite`.`request_path` FROM `catalog_category_flat_store_1` AS
   `main_table`  LEFT JOIN `core_url_rewrite` AS `url_rewrite` ON
   url_rewrite.category_id = main_table.entity_id AND
   url_rewrite.is_system = 1  AND url_rewrite.store_id = 1 AND
   url_rewrite.id_path LIKE 'category/%' WHERE (path LIKE '1/2/10/%')
   AND (main_table.store_id = '1') AND (is_active = '1') AND (level <=
   4) AND (level > '2') ORDER BY level ASC, position ASC";i:1;s:4432:"#0
   /usr/share/nginx/www/default/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
   Zend_Db_Statement_Pdo->_execute(Array)
   #1 /usr/share/nginx/www/default/app/code/core/Zend/Db/Statement.php(291):
   Varien_Db_Statement_Pdo_Mysql->_execute(Array)
   #2 /usr/share/nginx/www/default/lib/Zend/Db/Adapter/Abstract.php(480):
   Zend_Db_Statement->execute(Array)
   #3 /usr/share/nginx/www/default/lib/Zend/Db/Adapter/Pdo/Abstract.php(238):
   Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
   #4 /usr/share/nginx/www/default/lib/Varien/Db/Adapter/Pdo/Mysql.php(428):
   Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
   #5 /usr/share/nginx/www/default/lib/Zend/Db/Adapter/Abstract.php(737):
   Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
   #6 /usr/share/nginx/www/default/lib/Varien/Data/Collection/Db.php(734):
   Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
   #7 /usr/share/nginx/www/default/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521):
   Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
   #8 /usr/share/nginx/www/default/lib/Varien/Data/Collection/Db.php(566):
   Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
   #9 /usr/share/nginx/www/default/app/code/community/TM/EasyCatalogImg/Block/List.php(131):
   Varien_Data_Collection_Db->load()
   #10 /usr/share/nginx/www/default/app/design/frontend/base/default/template/tm/easycatalogimg/list.phtml(2):
   TM_EasyCatalogImg_Block_List->getCategories()

   ... cut irrelevant parts ...

   #34 {main}";s:3:"url";s:15:"/gostinaja.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

/gostinaja.html - is the address of subcategory I clicked on

Where the error is?

Thanks in advance!


texts: Login with Paypal button integration as per new API change

texts:
Paypal has recently sent an email saying to update the integration for login with paypal button.  Deadline is 4th April 2019
What should be the URL for this login with paypal button.

i.e. - with what I should replace

api.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize

What should be correct URL as per new Integration.


texts: Magento 2.2.4 - Moving and removing reference block in default.xml not working on localhost

texts:
This is my first theming product using Magento 2. I have themed Magento 1.9 previously (twice).

I have tried to move elements or remove blocks in the default.xml file but nothing seems to be working.

I created a child theme off of Luma and it has been set to that child theme in configurations.

File I'm using to move and remove blocks is /my-theme/Magento_Theme/layout/default.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Poppins:500,600">
</head>
<body>
    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_file" xsi:type="string">images/logo.svg</argument>
            <argument name="logo_alt" xsi:type="string">The Platform</argument>
            <argument name="logo_img_width" xsi:type="number">200</argument>
            <argument name="logo_img_height" xsi:type="number">35</argument>
        </arguments>
    </referenceBlock>

    <referenceBlock name="form.subscribe" remove="true" />
</body>
</page>

I have cleared all cache, remove static files, ran the command line php bin/magento setup:upgrade but still nothing.

Do I need to do anything different if I'm doing this on localhost? I'm also using MAMP if that makes any difference.

Any help will be greatly appreciated.


texts: Magento 2: how to get attribute additional options programmatically

texts:
In Magento 2.2.3, you can set additional options per each option of attribute:

How to programmatically access these properties? I tried:

$om =  \Magento\Framework\App\ObjectManager::getInstance();
$productAttributeRepository = $om->create('Magento\Catalog\Model\Product\Attribute\Repository');
$options = $productAttributeRepository->get('shoecolor')->getOptions();
foreach ($options as $option) {
    echo $option->getValue().' - '.$option->getLabel(). ' - '.$option->getMetaDescription().'<br>';
}

I know, we should avoid using ObjectManager, but wanted a fast way to see if I can pull this data, then I would create a Plugin for it.

$_helper->productAttribute($_product, $_product->getAttributeDescription(), 'shoecolor')

Neither worked and I can't find anything useful on Google, only on how to retrieve options per attribute, nothing about additional options for options of attributes.

What I want to get is a Description and Image. If anyone can help me with this, I would appreciate it.


texts:
I have checked if the server configuration is correct using php script the server is able to send email.

cron AOE scheduler is installed and it does not show any errors.

Generate Schedules Every 15
Schedule Ahead for 20
Missed if Not Run Within 15
History Cleanup Every 10
Success History Lifetime 60
Failure History Lifetime 600
Mark job as failed after 15

cron job in cpanel set for every 5 min
php -f /home/username/public_html/cron.php

Still magento does not send any emails.
No registration email
no forget password email
no sales email nothing. Please help me out.


texts: How to get ordered items associated with tracking numbers?Magento by default does not save mapping between order items and their tracking number. In case there are multiple packages, single shipment and multiple tracking numbers then how can we identify which tracking number belong to which package??


texts: Modern Magento 1.X Workflow and Development Tools

texts:
I am new to Magento Development ( CE 1.6 ) and am still trying to define my workflow. I currently develop on Mac OSX 10.8 with Netbeans 7.3, but I find that Netbeans is slow and freezes on me. I tend to switch over to Sublime Text 2 to do quick viewing/editing of files, or I'll just pull up Vim sometimes for convenience.

My questions:

"What does a modern Magento 1.X workflow look like?"
"What tools/configurations/plugins are best suited for Magento Development?"

I know that this is a subjective thing, and there isn't going to be 'one workflow to rule them all', but I also believe that all of you certified/experienced developers would have some common choices. At the very least, I would expect some battle tested knowledge.

I would appreciate any input/feedback/suggestions.

Thank you!


texts:
looking for a way to use a grid layout for CMS pages (such as home page) of magento2 - theme copied from Luma into a custom.

would like to have the ability to set up two divs to float side by side, like you can do with bootstrap such as this:

but without creating custom classes for it? (I tried adding bootstrap, but it comflicts with whatever Magento is using for Luma's responsiveness) - so I figured, maybe they have some classes I can tie into?


texts:
There's a big difference when using:

$_cartQty = $this->getSummaryCount();

and

$_cartQty = Mage::helper('checkout/cart')->getCart()->getItemsCount();

Results are totally different (12 vs 4).

The same when inspecting the elements using:

$_items = $this->getRecentItems();

or

$_items = Mage::helper('checkout/cart')->getCart()->getItems();

Why is that?


texts: Wishlist added products icon not active in Magento 2.3

texts: Wishlist added products icon not active or color change in product detail page and listing. But added products are present in "MY WISH LIST" in Magento 2.3


texts: how to implement "build your own product" feature in magento

texts: I want to implement the "build your own product" feature for my products. I want something similar to this http://demo.magentocommerce.com/gaming-computer.html with file upload facility. Any idea how to go about it?


texts:
I am using the latest Magento DE version (1.9.0.1) and while everything else works fine (like "Regular price") "Special price" is not translated. I've tried changing the "Mage_Catalog.csv" in the "locale/de_DE" folder and it is there. I noticed, that other than said in the translation file there is no column behind "Special price", so I changed the file to:

"Special Price:","Sonderpreis:"
"Special Price","Sonderpreis:"
"Special Price: %s","Sonderpreis: %s"
"Special Price %s","Sonderpreis: %s"

(just for testing purposes of course) and it still won't change. As far as I can tell the text is called in the price.phtml file as "Special price".  What am I missing?


texts:
I am having a problem with Magento open source 2.3.4 and its configuration to work with varnish 6. I have followed the devdocs about setting up varnish caching. I have verified that the varnish part works well with nginx and php-fpm by verifying that it works with a small demo page. The only part that is not working is Magento 2.3.4.

The nginx error log shows the following error:

2020/03/03 14:32:34 [error] 7273#7273: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Zend_Cache_Exception: cache_dir "/usr/share/nginx/html/magento2/var/page_cache" is not writable in /usr/share/nginx/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php:209
Stack trace:
#0 /usr/share/nginx/html/magento2/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/usr...')
#1 /usr/share/nginx/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php(87): Zend_Cache_Backend_File->setCacheDir('/usr/share/ngin...')
#2 /usr/share/nginx/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array)
#3 /usr/share/nginx/html/magento2/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)
#4 /usr/share/nginx/html/magento2/vendor/magento/framework/App/Cache/Frontend/Factory.php(156): Zend_Cache::factory('Magento\\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, tr" while reading response header from upstream, client: 127.0.0.1, server: www.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.example.com"

It is clear that magento thinks it should be using its built in full page cache because it is trying to access var/page_cache. A correct installation using varnish would not be attempting to access this directory.

I have configured magento to use varnish. Does anybody have any insight as to why it is not working correctly?


texts: How can I delete all pending review on Magento 2?

texts:
On My Magento 2 Site guest review was enabled, Someone spam review around several hundred thousand, I need to delete all pending reviews from the database. I am not interested to truncate reviews because there some real reviews approved. Also, delete from admin a few day's tasks.
I got below table:
email_review
review
review_detail
review_entity
review_entity_summary
review_status
review_store

rating
rating_entity
rating_option
rating_option_vote
rating_option_vote_aggregated
rating_store
rating_title

Any suggestion DELETE FROM review; as relation table data.


texts: Get selected custom options value Magento 2.2

texts:
I created an observer on checkout_onepage_controller_success_action event, I want to get selected custom options values for this particular order. How can I do this please help? Please check the following code:

public function execute(Observer $observer) {

    $order_id = $observer->getEvent()->getOrderIds()[0];

    // \Magento\Sales\Api\OrderRepositoryInterface
    $order = $this->_orderRepositoryInterface->get($order_id);

    $order_items = $order->getItems();

    foreach ($order_items as $order_item) {
        //Here I want to get selected custom options values for each item
        //With other fields like product name, price and other product related data
    }
}


texts: Unable to apply data patch for module Magento_CatalogRuleSampleData

texts:
Unable to apply data patch Magento\CatalogRuleSampleData\Setup\Patch\Data\InstallCatalogRuleSampleData for module Magento_CatalogRuleSampleData. Original exception message: Rolled back transaction has not been completed correctly.
Getting this error while trying to setup sample data, bin/magento setup:upgrade


texts: How to override a bad extensions controllers?

texts:
Synopsis

I am trying to extend an admin controller of a module, however the frontend router and adminhtml router share the same frontname.  I've tried so many things and none of them are working.

Extension router example

 <admin>
    <routers>
        <AdvancedStock>
            <use>admin</use>
            <args>
                <module>MDN_AdvancedStock</module>
                <frontName>AdvancedStock</frontName>
            </args>
        </AdvancedStock>
    </routers>
</admin>

... snip ...

<frontend>
    <routers>
        <AdvancedStock>
            <use>standard</use>
            <args>
                <module>MDN_AdvancedStock</module>
                <frontName>AdvancedStock</frontName>
            </args>
        </AdvancedStock>
    </routers>
</frontend>

Attempts

Attempt 1

<admin>
    <routers>
        <Vendor_AdvancedStock>
            <args>
                <modules>
                    <Vendor_AdvancedStock before="MDN_AdvancedStock">Vendor_AdvancedStock</Vendor_AdvancedStock>
                </modules>
            </args>
        </Vendor_AdvancedStock>
    </routers>
</admin>

Attempt 2

<frontend>
    <routers>
        <Vendor_AdvancedStock>
            <args>
                <modules>
                    <Vendor_AdvancedStock before="MDN_AdvancedStock">Vendor_AdvancedStock</Vendor_AdvancedStock>
                </modules>
            </args>
        </Vendor_AdvancedStock>
    </routers>
</frontend>

Attempt 3

This was attempt 1 and attempt 2 combined.

Attempt 4

<frontend>
    <routers>
        <AdvancedStock> <!-- this is the original vendors tag -->
            <args>
                <modules>
                    <Vendor_AdvancedStock before="MDN_AdvancedStock">Vendor_AdvancedStock</Vendor_AdvancedStock>
                </modules>
            </args>
        </AdvancedStock>
    </routers>
</frontend>

I have even added the depends tag and tried the above attempts with no success.


texts: How to write Unit test for my blocks in magento 2

texts:
I have created a module and its working fine.

I want to write Unit test for it(i know that i should write unit test before writing code).

I tried this way , but i am not clear about it.

My Block File - (app\code\Mycompany\Careers\Block\Index)

<?php
namespace Mycompany\Careers\Block\Index;
class Index extends \Magento\Framework\View\Element\Template {

protected $_careersFactory;
  public function __construct(
    \Magento\Catalog\Block\Product\Context $context,
    \Mycompany\Careers\Model\CareersFactory $careersFactory,
    array $data = []) {
    $this->_careersFactory = $careersFactory;
    parent::__construct($context, $data);

  }

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

/**
* this function return all the jobs currently active in careers extension
**/
  public function getAllCareers(){

    $Careers = $this->_careersFactory->create();
    $collection = $Careers->getCollection();
    $collection->addFieldToFilter('active',1);

    return $collection->setOrder('sort_order','ASC');
  }//End of function getHomepageBanners
}

I created my unit test file like this
file IndexTest.php - (app\code\Mycompany\Careers\Test\Unit\Block)

<?php
namespace Mycompany\Careers\Test\Unit\Block;
use Mycompany\Careers\Block\Index\Index;

class IndexTest extends \PHPUnit_Framework_TestCase
{
   protected $careers;

   public function setUp()
   {
    $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
    $this->careers = $objectManager->getObject('Mycompany\Careers\Block\Index\Index');

   }

   public function testGetAllCareers(){

      //What should i want to write here?

   }
}

for this what should i write in side my testGetAllCareers() method?.
What else i want to do for this?


texts: I try to upgrade my site magento2.2.4 to magento2.2.6 but it shows the following error


texts: How do I translate dynamic content, e.g "Only X left"

texts:
I've been trying to translate my entire site, and so far it is good. My only problem is that I cannot translate the "Only X left" text on my product page. How can I change this?
Thanks
Sebastian


texts: How to get the title or another attribute of an Image in PHP

texts:
I am building a custom shirt builder for a website http://mytempsite.net/gotie/mixandmatch

What I have setup is step one, they will select a shirt color from 12 different shirts and then move on to the next step where they will be able to choose a tie. I need to be able to pass a variable to that next page telling it to only pull images with ties on it for example the red shirt.

My thought of doing this is by having that attribute at the image alt or title tag and then getting that attribute from the current image that is being displayed.

What i need to know is how?

i tried using this code as a start

<?php
    $url=$this->helper('core/url')->getCurrentUrl();;

    $html = file_get_contents($url);

    $doc = new DOMDocument();
    @$doc->loadHTML($html);

    $divs = $doc->getElementByID('loadarea');

    foreach ($divs as $div) {
           echo "Found the loadarea div
";
    }
?>

but it didn't work, and it also caused my page to load really slowly.

just in case here is code to thumbnails

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

    foreach($products as $prod) {
        $product = Mage::getModel('catalog/product')->load($prod->getId());
        $pro_title = $product->getName();
        $img = $product->getImageUrl();

        echo "";

}?>

I hope that i worded this question correctly as to not be too localized. If so i will reword it.


texts: Issue with URL Path of child category after change URL key of Parent category

texts:
I have an issue with URL path of child categories. I have changed URL key of the category , but still child category URL path with old URL key of the parent category.

On the category page, i am displaying child categories of the current category.

For example, i have Car is parent category. Previous URL key was car after I have changed it to car-type but still child category i.e www.example.com/car/suv.html

It should be www.example.com/car-type/suv.html

I am getting url by $category->getUrl()


texts: Refund Orders to Payment Method (MAGENTO 1)

texts:
I am trying to create a script where i can pass

order_number
product_sku
qty

& it should issue a refund to the customer's payment method.
PS. I am using Magento ver. 1.14.2.4.
Basically i am trying to refund payment to customer's payment method
Is their any script available that can be used with/for this functionality ?
Feel free to share thoughts.
Thankyou


texts: i have my code but i cant show this in my page

texts:
$collection = Mage::getModel('web/web')->getCollection()->setOrder('web_id', 'ASC');
//$a = array();
foreach ($collection as $value) {
    $date = date("Y-m-d",strtotime($value['created_time']));
    $a[$date][] = $value['filename'];
    //$d[] = $date;

}
//echo $a[0];
echo "<pre>";
//print_r($d);
print_r($a);
echo "<pre/>";


texts:
Cron has been an issue ever since 1.8/1.9 or whenever Magento made cronjobs mandatory. I've done everything I could possible do and am at my wits end. I'm seriously considering doing a fresh install of Magento and starting all over. I'm calling cron by both cron.sh and cron.php. I've modified cron.php and added     $isShellDisabled = true; where it needs to be. I've installed AOE Scheduler. With that extension, I can see everything scheduled that is never executed. I checked the cron_schedule table in the database and it is constantly empty no matter what I do. I've checked with the host provider and they inform me that cron is executing properly. I've even changed the permissions of cron.php and cron.sh to 7, 5, 5.

I get these emails...

Cron error while executing core_email_queue_send_all:

exception 'Mage_Core_Exception' with message 'Too late for the schedule.' in /home/lbingman/public_html/app/Mage.php:595 Stack trace:
#0 /home/lbingman/public_html/app/code/community/Aoe/Scheduler/Model/Observer.php(47): Mage::throwException('Too late for th...')
#1 /home/lbingman/public_html/app/code/core/Mage/Core/Model/App.php(1357): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#2 /home/lbingman/public_html/app/code/core/Mage/Core/Model/App.php(1336): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#3 /home/lbingman/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#4 /home/lbingman/public_html/cron.php(76): Mage::dispatchEvent('default')
#5 {main}

I'm not sure what to make of them. I've missed an order by a few days because I was never notified by email.

UPDATE: Just as I type this, I see that cron was just executed and I received a test email that I sent myself via a test order. However, the cronjob was scheduled to run at 1:38AM and I saw in AOE Scheduler that the cronjob was executed at 1:45AM. This boggles my mind because I have cronjobs on the server set to run every minute.

Just when I think I may have the problem nailed down to one area, something else happens to completely throw me off again. Does anyone have any idea what is going on? I can't believe I'm the only one having this problem.

EDIT: I should note that when I manually execute cron.php by typing in the link to it in the web browser, cron executes and all of the past unexecuted tasks show up as "Success" in the AOE Scheduler extension.


texts: New attribute not save in table Mage_Sales_Model_Resource_Setup

texts:
My script runs perfect but dont save the new attribute in database.... why? thanks.
config.xml

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

    <global>
        <models>
            <incomm>
                <class>Itep_Incomm_Model</class>
                <resourceModel>incomm_mysql4</resourceModel>
            </incomm>
        </models>

        <catalog>
            <product>
                <type>
                    <incomm_virtual translate="label" module="incomm">
                        <label>Incomm Virtual</label>
                        <model>incomm/product_virtual</model>
                        <price_model>incomm/product_price</price_model>
                        <is_qty>1</is_qty>
                    </incomm_virtual>
                </type>
            </product>
        </catalog>

        <resources>
            <incomm_setup>
                <setup>
                    <module>Itep_Incomm</module>
                    <class>Itep_Incomm_Model_Resource_Eav_Mysql4_Setup</class>
                </setup>
            <connection>
                    <use>core_setup</use>
                </connection>
            </incomm_setup>
            <incomm_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </incomm_write>
            <incomm_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </incomm_read>
        </resources>

    </global>
</config>

Script install in folder sql/incomm_setup/mysql4-install-0.1.0.php

    <?php
    $installer = $this;
    $installer->startSetup();

    //incomm_request_active_code att order
    $installer->addAttribute('order_item','incomm_request_active_code',
        array(
            'type' => 'text',
            'grid' => false
        )
    );
$installer->endSetup();

And the model/resource/eav/mysql4/setup.php

    <?php
    class Itep_Incomm_Model_Resource_Eav_Mysql4_Setup extends Mage_Sales_Model_Resource_Setup
    {

}

When i run the script, and go to search in database, i cant find the new attribute in table Mage_Sales_Model_Resource_Setup, but the script shows in core_resouce, why my code is not saving? thanks


texts: Can we save multiple shipping and billing address of customers?

texts:
I want to save multiple shipping and billing addresses of customer, If customer is logged in and on checkout page, when customer will add a new address that should be auto saved in his account and next time when customer will place order, then on checkout page when customer will click on address then customer will also be able to choose shipping and billing details from saved details in his cart ?
I am using Magento 2.4.0.
There is any solution is available ?
Regards


texts:
If I click on System > Tools > Backups create a database backup and restore it the shop breaks. Looks like the backup is canceled in the middle.
Could this be a PHP timeout problem or is this done by a cronjob?
Is this know not to work probably?
Update
Looks like this is a MySQL problem. Any idea what config value might cause this?
MySQL config
connect_timeout=120
delayed_insert_timeout=3000
innodb_lock_wait_timeout=600
interactive_timeout=28800
net_read_timeout=600
net_write_timeout=600
slave_net_timeout=3600
table_lock_wait_timeout=600
wait_timeout=18000

From what I can see in backup source code a lot of queries are running to create the dumpfile instead of a simple mysqldump...
Update 2
I increased wat_timeout with success by adding into app/code/core/Mage/Backup/Model/Resource/Db.php
$this->_write->query('SET session wait_timeout = 115200;');

But I noticed I get a 500 Internal Server Error
/index.php/admin/system_backup/create/key/a74b4...7978/?isAjax=true

with post data: type=db&maintenance_mode=0&backup_name=test&exclude_media=0&form_key=uPK54mu...


texts: Export products in 3rd party system that does not share the same server

texts:
I need to export products from Magento to 3rd party CMS, let's say Wordpress.

My store will look like this:

I don't need to integrate systems (neither sharing sessions, nor customers)
There would be only about 300 products with only limited information about the products (title, SKU, link, image, and description, so not cross-sells, any custom attributes, etc.)
There would be a multi-store view set up so it, probably, would be necessary to export products per store view.

This can be achieved by at least 3 options:

Using default Export functionality (Advanced Profiles) (perhaps
would need to add cron job feature for default functionality)
Magento extension: public endpoint with export data + Wordpress extension that will
    grab generated .xml files
Wordpress extension: using Magento SOAP API

What would be the right way to do this?


texts:
During the creation and deletion of some of the attributes in the past, I accidentally deleted the attribute weight. Now I want to fix this by creating the attribute again but I get the error The attribute code 'weight' is reserved by the system. Try another attribute code.

A backup restore is not an option because it's been some time since I've removed it. But now i want to use weight for shipping again so I need this.

How can I fix this


texts: Category chooser widget as system configuration field

texts:
I need a category chooser field in my modules config tab. I already saw a lot of widget tutorials, including this, from Alan Storm, and it is very helpful. But i want something more specific.

I need a widget like the one that is present in Promotions -> Cart Rules

When you open this chooser, the categories are listed and you can choose them with the checkbox. Then, the ID of the selected categories go to the field Category. That's what i want.

I would like to know where can i find the code about this widget in
magento or
If someone have a solution that do something like the print above.

I already saw some questions about this, like this one, but my solution must be for magento 1.9.x.


texts: Can't manually send transactional email?

texts:
I'm trying to send a transactional email template to myself manually (on a test.php page) but it won't send despite all of my efforts and research.

I've tried all three posts linked in this question and can't get it to send anything.

include_once "app/Mage.php";
umask(0);
Mage::app();

$mailTemplate        = Mage::getModel('core/email_template');
$translate           = Mage::getSingleton('core/translate');
$templateId          = 20;
$template_collection = $mailTemplate->load($templateId);
$template_data       = $template_collection->getData();

if(!empty($template_data))
{
    // var_dump($template_data);
    $templateId  = $template_data['template_id'];
    $mailSubject = $template_data['template_subject'];

    $from_email  = 'trvsw@example.com';
    $from_name   = 'trvsw';
    $sender      = array('name'=> $from_name,
                         'email' => $from_email);

    $vars        = array('customerName' => 'trvsw');
    $storeId     = 2;

    $model = $mailTemplate->setReplyTo($sender['email'])->setTemplateSubject($mailSubject);
    $email = 'trvsw@example.com';
    $name  = 'trvsw';
    echo "template ".$templateId." sender ".$sender['name'].", ".$sender['email']." email ".$email." name ".$name." vars ".$vars['customerName']." store id ".$storeId."
";
    $model->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
    if(!$mailTemplate->getSentSuccess()) {
        echo "Something went wrong...
";
    } else {
        echo "Message sent to ".$email."!!!
";
    }
    $translate->setTranslateInline(true);
}

Every time, it just spits out "Something went wrong..." Any ideas?

The transactional email is titled "Test" with the subject "Test" and the body

This is a test.

Thank you, {{var customerName}}

Edit:

Here is the exception that I'm finding in my exception.log

2015-08-06T13:15:01+00:00 ERR (3):
exception 'Zend_Mail_Protocol_Exception' with message '5.1.1 Recipient unknown
' in /var/www/sites/mbs/lib/Zend/Mail/Protocol/Abstract.php:431
Stack trace:
#0 /var/www/sites/mbs/lib/Zend/Mail/Protocol/Smtp.php(289): Zend_Mail_Protocol_Abstract->_expect(Array, 300)
#1 /var/www/sites/mbs/lib/Zend/Mail/Transport/Smtp.php(217): Zend_Mail_Protocol_Smtp->rcpt('travisw@example...')
#2 /var/www/sites/mbs/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#3 /var/www/sites/mbs/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#4 /var/www/sites/mbs/app/code/local/Moogento/Pickpack/Model/Core/Email/Templateattach.php(1983): Zend_Mail->send(Object(Zend_Mail_Transport_Smtp))
#5 /var/www/sites/mbs/app/code/core/Mage/Core/Model/Email/Template.php(508): Moogento_Pickpack_Model_Core_Email_Templateattach->send('travisw@example...', 'trvsw', Array)
#6 /var/www/sites/mbs/test.php(50): Mage_Core_Model_Email_Template->sendTransactional('Test', Array, 'travisw@example...', 'trvsw', Array, '1')
#7 {main}


texts: Proper way to replicate Magento 2 Project from git

texts: I have worked on some Magento 2 Projects, the main problem is when I pull every Magento 2 projects from git and load the project in the browser it always asks me to do the fresh installation, even after I configure the app/etc/env.php and the database properly


texts: Magento 2 How to add new method in override block

texts:
For example, I've to override class Magento\Store\Block\Switcher to Vendor\Module\Block\Switcher Now I need to add custom method, constructor, and protected variable in upgraded class Vendor\Module\Block\Switcher.

I've tried following code but it's not working

Add code like below in /etc/frontend/di.xml file.

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

Add below code in my override class Vendor\Module\Block\Switcher

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

class Index extends \Magento\Framework\View\Element\Template
{

  protected $httpContext; //new variable

  public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
    \Magento\Framework\App\Http\Context $httpContext, // Inject New Class Just before Data array if you want to inject
    array $data = []
    ) {

      $this->_postDataHelper = $postDataHelper;
      $this->httpContext = $httpContext; //New object Get of Injected Class
      parent::__construct($context, $data);
    }

    /**
     * Code by devloper
     */
    public function isLoggedIn()
    {
        return (bool)$this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);
    }

    /**
     * Code by developer
     */
    public function getBankUrl()
    {
        if (!$this->isLoggedIn()) {
            return '
Bank sd
';
        } else {
            return '
getUrl('rewards/referral').'">Bank
';
        }
    }
}

?>


texts: Blocks not displayed (only in luma theme)

texts:
sorry, I am a bloody beginner, so this question might be obvious to someone else. However, I cannot figure them out. I have a blank Magento (2.2.6) installation and I want to customize it (couple plugins and my own theme).

By default, there is the Luma theme. It shows some content defined in the content > blocks (i.e. Footer Links Block, Home Page Block, etc...).  If I switch the theme to blank they don't show up anymore. Why? Where is this defined, I cannot find anything in the luma themes code that references those blocks.

So next I want to create my own theme, extending Luma. I do so just by defining my Theme according to the docs (registration.php, composer.json and theme.xml with <parent>Magento/luma</parent>. It is then displayed in the list of themes as it should, also showing Luma as its parent theme. However switching to my theme just looks like the blank theme, not the Luma theme. Why that?

Next attempt was to copy all the code from the Luma theme into my theme. And voila it almost looks like Luma. The only thing is still that content blocks are not displayed as they are in Luma. Again, where is the definition for that?

BTW:

I have developer-mode enabled, and i think all possibly helpful scripts habe been run in each individual step including setup:upgrade, setup:di:compile, setup:static-content:deploy -f, cache:clean and cache:flush

Magento 2.2.6
PHP 7.1.21


texts: How to get specific selected related products in magento2

texts:
if((bool)$checkoutQuote->getInstallmentEnabled()==true&&$allRelatedProductIds->getSelect()->getId()!=null){

As the title, i am trying to get the related product that the customer has selected and it cannot be null. However, this condition has been put into a beforeSave() function in a customplugin.php so that it will check the condition before add to cart.


texts: Magento 2 how to get total products weight in order summary

texts: How can i get total products weight in order summary tab where Subtotal and Shipping will be displayed as my req is should display total products weight in cart.


texts: How to add product updated date as sort order using custom extension

texts:
I want to add product updated date as sort order but I don't want to add Updated date field in product setting page which means if admin updates a product, it's edited date should be detected automatically.

Ref:

I want to achieve this using custom module.

I am using magento 1.9.0.1.


texts: Magento 2 website redirects to older URL

texts:
I have moved my magento project to another location.
I cleared the

var/cache
var/page_cache
var/generation
var/session
var/view_preprocessed
and made changed the core_config_data

But it is still redirecting to the older URL


texts:
I'm trying to work with the new RWD theme, but i'm not happy with compass watch, as it is very slow and I can't find my way around it.

Dose any one know how to use gulp instead? my main problem with the import path it didn't work and I keep getting errors.

gulp.task('css', function() {
  var stream = gulp
    .src(['scss/styles.scss'])
    .pipe(compass({
        import_path: '../../../rwd/default/scss',
        css: 'css',
        sass: 'scss',
        image: 'src/images'
    }))
    .pipe(gulp.dest('../css'));

  if (config.minifyCss === true) {
    stream.pipe(minifycss({keepSpecialComments: '0'}));
  }

  return stream
    .pipe(gulp.dest('../css'))
    .pipe(notify({ message: 'Successfully compiled SASS' }));
});

Thanks


texts: Magento 2: Memcache causing issue on checkout payment page

texts:
I have installed Memcache on my server using WHM and add Memcache settings in env.php file by following the Magento docs. Also, test the Memcache is running.
But I am facing one issue here. When I place an order and make an online payment using Authorize.net.

Scenario

first time It works successfully.
When I tried again to place an order using on online payment. it redirects to checkout cart page with the empty cart.
When I flush the cache it works.
When I remove the Memcache settings from env.php. It works.

I googled to exclude cart and checkout page from Memcache. But didn't find any way to exclude these pages.

In Magento checkout module, the checkout_index_index.xml has already cachable = false in its block.

Please suggest.


texts: How can i filter in sales order grid magento 2?

texts:
While i am using same code for filter it's working but i have break other grid  like customer,invoice,cms page and get error "Not registered handle cms_page_listing_data_source"

While i have moved di.xml file in etc/ folder grid filter not working. any have idea about.

I have created di.xml file in etc/adminhtml/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="sales_order_grid_data_source" xsi:type="string">Vendor\Module\Model\ResourceModel\Order\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
</config>

FIlter collection in

<?php
namespace Vendor\Module\Model\ResourceModel\Order\Grid;

use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Sales\Model\ResourceModel\Order\Grid\Collection as OriginalCollection;

class Collection extends OriginalCollection {
    protected $_authSession;
    public function __construct(
        EntityFactory $entityFactory,

        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        \Magento\Backend\Model\Auth\Session $authSession
    ) {
        $this->_authSession = $authSession;
        parent::__construct($entityFactory, $fetchStrategy, $eventManager);
    }

    protected function _renderFiltersBefore() {
        $user = $this->_authSession->getUser();
        $joinTable = $this->getTable('sales_order');
        $this->getSelect()->where('stockist_id = ' . $user->getId());
        parent::_renderFiltersBefore();
    }
}


texts:
Can magento do processing and changing the order status over api?

We're planning to do drop-shipping for another webshop, running magento.
We're supposed to get the orders by pulling from the API (possible).
But it does not seem possible to tell the magento shop that the order have been processed and the payment can now be drawn from the credit card, let alone know if the payment have failed, so the order should not be sent. (We have the rule in our country that we can not get the money before we are shipping the order).

Am I missing something; I can't see anything in the api documentation.


texts: how to use shopping cart rules to restrict postcode

texts:
We have small business and we deliver goods to only specific postcodes.How can i restrict purchase to only those postcodes.I have read that i can do it from shopping cart rules.So,I created one rule for postcode from shopping cart rules but I don't know from where i can add my postcodes and how to apply that rule to shipping and stop purchasing in other postcodes.
Please help.


texts: Magento2.3.2 to Magento2.3.3 update deploy error

texts:
After Magento2.3.3 upgrade got some error like below statement.

php bin/magento setup:static-content:deploy -f

Deploy using quick strategy
frontend/Magento/blank/en_US            3148/3247           ===========================> 96%    4 secs
Compilation from source: /chroot/home/html/vendor/magento/theme-frontend-blank/web/css/styles-m.less
No matching definition was found for `@family-name:'Open Sans', @font-path:'../fonts/opensans/light/opensans-300', @font-weight:300, @font-style:normal, @font-display:swap` in _typography.less on line 11, column 5
09|
10| & when (@media-common = true) {
11|     .lib-font-face(
12|         @family-name: @font-family-name__base,
13|         @font-path: '@{baseDir}fonts/opensans/light/opensans-300',
14|         @font-weight: 300,
Compilation from source: /chroot/home/html/vendor/magento/theme-frontend-blank/web/css/email-fonts.less
No matching definition was found for `@family-name:'Open Sans', @font-path:'../fonts/opensans/light/opensans-300', @font-weight:300, @font-style:normal, @font-display:swap` in _typography.less on line 11, column 5
09|
10| & when (@media-common = true) {
11|     .lib-font-face(
12|         @family-name: @font-family-name__base,
13|         @font-path: '@{baseDir}fonts/opensans/light/opensans-300',
14|         @font-weight: 300,

In File.php line 151:

  The contents from the "/chroot/home/html/pub/static/frontend/Magento/blank/en_US/css/styles-m.min.css" file
   can't be read. Warning!file_get_contents(/chroot/home/html/pub/static/frontend/Magento/blank/en_US/css/sty
  les-m.min.css): failed to open stream: No such file or directory

Any any help me.

Advance thanks


texts:
Situation is: we have no robots.txt file in this project. It is not in root folder. It is not in /pub folder. But... If we browse ourdomain/robots.txt it is loaded & printed (containing just the sitemap url)

I am not asking here about that concrete content (for this project, it is ok as it is), but the responsible of generating that content

So, question is... If the file does not exist in filesystem, should we asume its content is generated on the fly? Does Magento do this natively? Or should we asume this is caused by some 3rd party module?