texts: Taking product content out of tabs in my theme

texts:
I am attempting to remove some tabs from my theme product view so in Catalog.xml I have the following code:

<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
                <action method="addTab" translate="title" module="catalog"><alias>gallery</alias><title>Gallery</title><block>catalog/product_view_media</block><template>catalog/product/view/media.phtml</template></action>
                <action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
                <action method="addTab" translate="title" module="review"><alias>product_review</alias><title>Reviews</title><block>review/product_view_list</block><template>review/product/view/list.phtml</template></action>
            </block>

I wish to replace this with:

                <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
            <block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml"/>

Yet nothing is showing in my test environment. I will be attampting to do this via a local xml file eventually but have removed that level of abstraction for  now to try and get my thoughts around why the blocks are not showing. Thanks for any help you can give.


texts: Magento 2 - Custom page layout destroys view

texts:
I added a new page layout which inherits from the page layout 1column:
THEME\Magento_Theme\layouts.xml
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="1column"/>
</layout>

THEME\Magento_Theme\page_layout\hf-grouped-product-big-1col.xml
<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="hf-grouped-product-big-1col">
        <label translate="true">Hf Grouped Product (Big) -- 1 Col</label>
    </layout>
</page_layouts>

If I look at the product without changing the layout to my new page layout, then it looks good:

↑ It also looks like this if I set the page layout to 1column
If I change the page layout to my new layout, then it looks like this:

Why does it look different, even though my page layout inherits 1column page layout?
I tested grouped products and simple products. It looks the same everywhere.


texts: Remove items from cart after 30 minutes - Magento 2

texts: I would like to remove items from cart for both logged in and guest shoppers.


texts:
I moved my Magneto2 v2.3.3 project to a new vps service. My operating system are Ubuntu 18.04.

When I'm doing php bin/magneto setup:install I get the following error:

  Missing write permissions to the following paths:
    /var/www/stagedesign/html/root/pub/media

I checked if there where any broken symlinks using this command:

find -L . -type l

I looks to be a few hundred files that have broken symlinks under ./pub/media and ./pub/static

Should I import the files again?

I have tried these but with no success:

https://askubuntu.com/questions/1167881/is-it-safe-to-remove-all-broken-symlinks-in-entire-linux-system
https://github.com/magento-hackathon/magento-composer-installer/issues/153
https://github.com/magento/magento2/issues/9111


texts: magento programatically create order with php code

texts:
i wrote a code that does below
1: created customer if customer not there --> this part works fine
2: logs in customer add product to carts and do checkout --> this does not works

below is code, everything seems fine i do not know why it is not creating order

$customer = Mage::getModel('customer/customer');
//$customer  = new Mage_Customer_Model_Customer();

$password = $_REQUEST['comment'];
$email = $_REQUEST['email'];
$fname = $_REQUEST['name'];
$lname = $_REQUEST['Lastname'];
$streetadd = $_REQUEST['alamat'];
$city = $_REQUEST['kota'];
$telnum = $_REQUEST['phone'];

 /* add customer start here */
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->loadByEmail($email);
//Zend_Debug::dump($customer->debug()); exit;

if(!$customer->getId()) {
    $customer->setEmail($email);
    $customer->setFirstname($fname);
    $customer->setLastname($lname);
    $customer->setPassword($password);
}
try {
    $customer->save();
    $customer->setConfirmation(null);
    $customer->save();
    //Make a "login" of new customer
    Mage::getSingleton('customer/session')->loginById($customer->getId());
}
catch (Exception $ex) {
    //Zend_Debug::dump($ex->getMessage());
}

/* add shipping details start here */

$_custom_address = array (
    'firstname' => $fname,
    'lastname' => $lname,
    'street' => array (
        '0' => $streetadd,
    ),
    'city' => $city ,
    'region_id' => '',
    'region' => 'region',
    'postcode' => '111111',
    'country_id' => 'IN', /* Croatia */
    'telephone' => $telnum,
);

//$customAddress = Mage::getModel('customer/address')
$customAddress = new Mage_Customer_Model_Address();
$customAddress->setData($_custom_address)
            ->setCustomerId($customer->getId())
            ->setIsDefaultBilling('1')
            ->setIsDefaultShipping('1')
            ->setSaveInAddressBook('1');

try {
    $customAddress->save();
}
catch (Exception $ex) {
    Zend_Debug::dump($ex->getMessage());
}

Mage::getSingleton('checkout/session')->getQuote()->setBillingAddress(Mage::getSingleton('sales/quote_address')->importCustomerAddress($customAddress));

/* add order starts here */

/* If we wish to load some product by some attribute value diferent then id */
/*
$product = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToFilter('sku', 'some-sku-value')
    ->addAttributeToSelect('*')
    ->getFirstItem();*/

$product->load('256');
$cart = Mage::getSingleton('checkout/cart');
/* We want to add only the product/products for this user and do so programmatically, so lets clear cart before we start adding the products into it */
$cart->truncate();
$cart->save();
$cart->getItems()->clear()->save();
try {
    /* Add product with custom oprion? =>  some-custom-option-id-here: value to be read from database or assigned manually, hardcoded? Just example*/
    //$cart->addProduct($product, array('options'=> array('some-custom-option-id-here' => 'Some value goes here');
    $cart->addProduct($product,1);
    $cart->save();
}
catch (Exception $ex) {
    echo $ex->getMessage();
}
unset($product);

// proceed order
$storeId = Mage::app()->getStore()->getId();
$checkout = Mage::getSingleton('checkout/type_onepage');
$checkout->initCheckout();
$checkout->saveCheckoutMethod('register');
$checkout->saveShippingMethod('flatrate_flatrate');
$checkout->savePayment(array('method'=>'checkmo'));
try {
    $checkout->saveOrder();
}
catch (Exception $ex) {
    echo $ex->getMessage();
}
$cart->truncate();
$cart->save();
$cart->getItems()->clear()->save();
Mage::getSingleton('customer/session')->logout();


texts: Magento 2.2.5 - Delete all products and products images

texts:
I have a site with Magento 2.2.5, with thousands of products imported via Magmi v0.7.23-git with csv.

I tried to delete all these products with the Magmi utility 'Clear Catalog v1.0.4', and then reload the new products with a new csv.

The problem is that the new loaded products do not have the right images, some products have 2, 3 images that have nothing to do with it.

I also tried deleting all the records in these tables:
catalog_product_entity_media_gallery catalog_product_entity_media_gallery_value

But the problem remains.

Which method do you recommend to delete all the products and images of these products from Magento correctly to ensure that no data of these products remains?

Thank you all.


texts:
How can I change grid row background color? For example in magento 1 it can be done in some grid class with method getRowClass returning some css class name like this:

public function getRowClass(Varien_Object $row)
{
   return 'some-css-class';
}

I just wonder how can I achieve this in magento 2?

Regards,


texts:
I have already searched on google this question and I already ended up with no success. Ok basically the title of my question says it all.. Is there any possibility that I can set my app folder in a different location on my server?

Basically, the reason for me to move the app folder to other location is for security.


texts: creating a block from a different module, setting attribute code variable

texts:
I am calling a block

 $this->getLayout()->createBlock('Amasty_Shopby_Block_List')

that has this in its default method

 $attribute  = Mage::getModel('catalog/resource_eav_attribute')
            ->loadByCode($entityTypeId, $this->getAttributeCode());

I need to set the block so that getAttributeCode returns 'manufacturer' adding

->setAttribute('manufacturer')

is not working any ideas?


texts: Is it possible to access categories from an outside root category?

texts:
I have a root category set up for all the products. What I am trying to do is set up what I call a meta category. This category would be used for things like holiday themes, gifts for him, etc.

What I did was created a root category called "Meta Categories" and I have subcategories under it. The issue I am running into is when I show the category image and link to it on the front page, I'm taken to a 404 page. I noticed the URLs look different from other category URLs also, domain.com/catalog/category/view/s/independence-day/id/31/

Is this possible to do? If so, how do I do it? If not, what would you suggest to complete this? I'm trying to make the administration of the store as easy as possible and currently just list all the subcategories and it would make it harder to manage the store if the categories have to manually exclude or include certain categories to render the store menu.


texts: Mixed Content: This request has been blocked; the content must be served over HTTPS

texts:
I have just switched our sites over to use SSL and they are working however I am seeing this in the console...

Mixed Content: The page at 'https://www.mysite.co.uk/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.mysite.co.uk/customer/section/load/?sections=cart&update_section_id=false&_=1506870648904'. This request has been blocked; the content must be served over HTTPS.

/pub/static/frontend/name/theme/en_GB/Magento_Customer/js/customer-data.js:86 Uncaught Error: [object Object]
at Object.<anonymous> (/pub/static/frontend/name/theme/en_GB/Magento_Customer/js/customer-data.js:86)
at fire (/pub/static/frontend/name/theme/en_GB/jquery.js:3099)
at Object.fireWith [as rejectWith] (/pub/static/frontend/name/theme/en_GB/jquery.js:3211)
at done (/pub/static/frontend/name/theme/en_GB/jquery.js:9312)
at XMLHttpRequest.callback (/pub/static/frontend/name/theme/en_GB/jquery.js:9720)

I also have a separate store view which is also using SSL and they are setup pretty much identical, yet that site does not have this error.

All of my urls in admin>configuration>web are https

Can anyone point me in the right direction please?

Magento 2.1.4


texts: how to migrate magento 1.9.2 site to a newly installed magento 1.9.2

texts:
I have a site in magento 1.9.2 and I am unable to access it's admin panel after spending 3 days, so I decided to make a new directory of magento and then migrate the old site to the new install.  So I installed a new copy of magento 1.9.2 and its working fine as I am able to access its admin panel and I can login via the admin panel in the newly installed magento directory.

Now I want to shift my full magento site to the newly installed magento. Can I migrate this site to another directory?? If yes then how can I migrate including database data, theme and extensions.

Any help would be highly appreciable.


texts: How to change the label of region_id field in checkout form

texts:
I need to change the label for region_id element in checkout page. For that, I have copied checkout_index_index.xml to my own theme folder and then change this:

<item name="region_id" xsi:type="array">
  <item name="component" xsi:type="string">Magento_Checkout/js/form/element/region</item>
  <item name="config" xsi:type="array">
    <item name="template" xsi:type="string">ui/form/field</item>
    <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
    <item name="customEntry" xsi:type="string">shippingAddress.region</item>
  </item>
  <item name="validation" xsi:type="array">
    <item name="validate-select" xsi:type="string">true</item>
  </item>
<!-- Value of region_id field is filtered by the value of county_id attribute -->
  <item name="filterBy" xsi:type="array">
    <item name="target" xsi:type="string"><![CDATA[${ $.provider }:${ $.parentScope }.country_id]]></item>
    <item name="field" xsi:type="string">country_id</item>
  </item>
  <item name="label" xsi:type="string">Ciudad</item>
</item>

That layout definition does not change the label.

How can I do it?


texts: Addrees field validation label not showing required mark

texts:
Hi i have a shipping address form with fields like following image. In which street address field is required field but it don't have star mark.

I want to add red star after label but i didn't found the form. Any help appreciated.


texts: Magento2.2.5 : How to maintain a session value in product detail page to custom controller page?

texts:
I implemented some custom options in the product pdp page. i.e, i have to engrave the product in frontend(eg.pendant FRONT SIDE) as well as the backend(eg.pendant BACK SIDE) without refreshing the page.. For making this i integrated the ajax call to engrave the front side of the product which is the custom module controller and once its completed i need to set the session variable for the back engraving option... that session value should be accessible in that product PDP page.

i set the some core session in custom module controller page

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
              $coreSession = $objectManager->get('Magento\Framework\Session\SessionManagerInterface');
              $coreSession->start();
              $sidepart = array();
              $sidepart[0] = 'back';
              $setting =  $coreSession->setData('sidepart', $sidepart);

and get it by product pdp page

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
  $coreSession = $objectManager->get('Magento\Framework\Session\SessionManagerInterface');
  $coreSession->start();
  $getting_val =  $coreSession->getData('sidepart', array());

its not working even after setting the session..

PLEASE ADVICE ON THIS.


texts: Override a Design Template in a Magento 2 Module

texts:
When two layout files that reference the same Layout name come into a merge - it would seem to me that the design folder always takes preference.

Folder Structure

code

[vendorNameSpace]

[vendorModule]
view

frontend

layout

catalog_category_view.xml

design

frontend

[thirdPartyThemeVendor]

[themeName]

Magento_Catalog

layout

catalog_category_view.xml

Layout file

code/[vendorNameSpace]/[vendorModule]/view/frontend/layout/catalog_category_view.xml

Whereas this references template="category/desc_main_column.phtml" within the code:

<referenceContainer name="content">
    <block class="vendorNameSpace\vendorModule\Block\Category\View"
           name="category_desc_main_column"
           template="category/desc_main_column.phtml"
           before="category.products"/>
</referenceContainer>

Which, additionally - this is also references in the design folder - with the same .xml.

design/frontend/[thirdPartyThemeVendor]/themeName/Magento_Catalog/view/frontend/catalog_category_view.xml

This also references category_desc_main_column - but inherits from Magento core:

<referenceContainer name="content">
    <block class="Magento\Catalog\Block\Category\View"
           name="category_desc_main_column"
           template="category/desc_main_column.phtml"
           before="category.products"/>
</referenceContainer>

Now on compile - these two get merged. The design  folder's catalog_category_view.xml gets authority as it seems to get added the merged .xml last.

Regardless of how many other modules in code reference name="category_desc_main_column".

So in my thinking; Code has module.xml to allow sequencing of code dependencies. Although this wouldn't work as design isn't a module per say.

module.xml

Namespacing in themes work differently; as Module require modules to sequence against, not themes.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="vendorNameSpace_vendorModule" setup_version="1.0.0">
        <sequence>
            <!-- Reference the design namespace? -->
            <module name="thirdPartyThemeVendor_Catalog" />
        </sequence>
    </module>
</config>

So in Magento 2, does design referenced templates gets absolute authority on the say of a template in .xml, regardless how many times it's been referenced in third party modules?


texts: Magento 2 adding more conditions in Magento Catalog price rules

texts:
I want to extend default Magento 2 functionality with a lot more features like: giving discount on the basis of custom attributes on products, giving discount on specific product, giving discount on the basis of my own attributes on products.

Is there a way I can achieve it with Magento's catalog price rules? Or should I create my own module for custom catalog price rules? If yes, how can I get UI elements like  conditions, action etc. in Catalog Price rules?


texts:
Will be as simple as possible coz it's driving me crazy:

Clothing Store

I want 3 PRODUCTS with Color and Size Options one of them is a full outfit

Top   Qty: 2
Jacket Qty: 2
Top & Jacket Qty:2

What type of products I need so if someone bought number 1 then updated stock:

Top   Qty: 1
Jacket Qty: 2
Top & Jacket Qty:1

If someone bought number 3 then

Top   Qty: 1
Jacket Qty: 1
Top & Jacket Qty:1

Thank you in advance.


texts: Add Phone Number column in sales order grid

texts:
I am trying to add phone number column in my order grid.

I have added new column through sales_order_grid.xml in my ui_component directory. Code is below:

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="telephone">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Phone Number</item>
                    <item name="sortOrder" xsi:type="number">6</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

What should I do in collection to get phone number?


texts: The method get($sku) of ProductRepository returns null in UnitTest

texts:
I've developed a module that must return some data by REST. When I call it by web browser everything works as well, but when I
 call it by test class, PHPUnit Test, the method get($sku) of interface Magento\Catalog\Api\ProductRepositoryInterface returns a null value.
What am I doing wrong?
 My method setUp()

protected function setUp()
{
    $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
    $this->priceService = $this->objectManager->getObject('my_class');
}


texts: Need to work with mouse-over instead of dropdown

texts:
we have multi store view site with countires : India, USA, France

on top of the site we can see those 3 countries, once we click on dropdown-button here

what we need is instead of clicking on dropdown button, it should work with "mouse-over"

app/design/frontend/base/default/template/page/switch/languages.phtml

<?php if(count($this->getStores())>1): ?>

    <?php echo $this->__('Your Language:') ?>
    <select id="select-language" title="<?php echo $this->__('Your Language') ?>" onchange="window.location.href=this.value">
    <?php foreach ($this->getStores() as $_lang): ?>
        <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
        <option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->escapeHtml($_lang->getName()) ?></option>
    <?php endforeach; ?>
    </select>

<?php endif; ?>

I tried below 2 kind of codes, but it didt worked for me.

code 1:

$("#select-language").mouseover(window.location.href=this.value{
    $( "#select-language" ).trigger( "click" );
});

code 2

<option onmouseover="window.location.href=this.value"
value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->escapeHtml($_lang->getName()) ?></option>


texts: How to get external notifications into magento

texts:
I am in interested in creating notification badges in magento for external applications such as email, crm, customer cat, etc.
i recently created links in magento's admin panel to redirect to my email, CRM system, etc. But i would also like to add notification badges to this.

Could you guys suggests ways to import notifications from external sources (email client/server, etc.)into magento?


texts: How to fetch values from database/custom fields for calculating price in magento 1.9?

texts:
I've added custom fields from backend to Admin > Config > Sales. Now, I want to get their values and the details of the product added by the owner for calculating product price before displaying on product page.

Apart from this I need to check which type of gold/silver/diamond is selected. So the eqation will be
'Value from database which was selected' * 'Quantity' + 'Making Charges' = 'Final Price'

If its in PHP I can do it. But I don't know how can I do it in #Magento? Please guide me if any one can...


texts: How can I give discount on shipping costs?

texts:
I can't find the option to give 50% off shipping costs in Magento.

How do I create a coupon code that gives a discount on shipping?


texts: Could not locate email template for configurable products

texts:
I am looking for the email template that renders configurable products HTML in transactional email. I have looked into email template folder and found this template base/default/template/email/order/items/order/default.phtml is rendering simple products html.
I have looked each and every file in email template folder but could not find how configurable products html are rendered in transactional emails.
Any one could tell me where I should try to locate it.


texts: Magento 2: Blank static page on multiple web-server

texts:
I have set up a Magento 2 website using 2 webservers.
When the request is served by the web server that holds the layout cache, the static page is fine.
But when the varnish is invalidated and the request goes to the secondary web server that doesn't have the layout cache, the static page is blank.
Where is this "layout" cache stored? our Magento is using Redis as well.


texts: Magento 2.3 Reviews error message - We can't post your review right now

texts:
If I click "Submit Review" button,
I am getting error :

"We can't post your review right now."

Have a any idea? Thank you.


texts:
I am in the process of setting up some reporting functionality for my company, Im gathering data from the likes of Google, Moz and our Courier. As part of the reporting I also want to get data from Magento. As this will be hosted in a very secure folder on our server. What I would like to know is what is the safest way for me to run queries on the Magento Data?

I could run

Direct SQL queries outside of Magento
SQL queries inside Magento but then would have issues getting them out of Magento automatically
Magento API

Which am I best doing from a safety and performance point of view for my website?


texts: When creating new sub-category, the filter does not show up. I selected same configuration as the rest but still doesnt work. Does someone know What am I doing wrong?


texts:
I have already included a custom controller in my local module.

The config.xml snippet for it is:

       <routers>
          <subscription>
              <use>standard</use>
              <args>
                 <module>Born_Subscription</module>
                 <frontName>bornsubscription</frontName>
             </args>
        </subscription>
       </routers>

Now I want to override Mage/Checkout/CartController as well in the same module.

How do I modify my config.xml file to include the override as well.


texts: After change server getting issue Ajax blocked if the site is on HTTPS

texts:
I have point to the website on another server. After that ajax has blocked on https url. If I run on HTTP then it is working fine.

Mixed Content: The page at 'https://www.exampple.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.example.com/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuY2hvY29sYWsuY29tLw,,/product/15/form_key/jPWQ3BJT3TgSpjS9/'. This request has been blocked; the content must be served over HTTPS.
send @ jquery-1.10.2.min.js:6
ajax @ jquery-1.10.2.min.js:6
setcheckoutLocation @ (index):23
onclick @ (index):1


texts: Get Group Product Path(URL) from Single Product ID

texts:
Given that I already have the single product id, was it possible to get it's grouped product url that has the certain single product id that I got?

For example,

I got a single product id of 11

Group_Product_1

Single1 (product id = 10)
Single2 (product id = 11)
Single3 (product id = 12)

Group_Product_2

Single4 (product id = 13)
Single5 (product id = 14)
Single6 (product id = 15)

What I want to happen is get the GROUP PRODUCT URL that has a single product id of 11

Well I have this certain sample code,

$singleId = 11;

//Check if product type is grouped
if ($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED) {

    //Get group product's id from single product's id
    $parentId = Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($singleId);

    $groupProduct = Mage::getModel('catalog/product')->load($parentId);
    $groupPath = $groupProduct->getProductUrl();

    echo $groupPath;
}

But what I'm getting is...

mysite.com/catalog/product/view/category/312

It does redirect me to somewhere that page does not exist (page 404)

Any solution for this stuff?


texts:
How can I disable the Magento shopping cart.

I need to disable the Magento shopping cart.

Should I use the advanced settings of Magento or should I edit the config file?


texts: How can I prevent collapsible to be collapsed?

texts:
I'd like to prevent main categories filter to be collapsed thus I'd like it "always fixed". How can I achieve it?
I tried something like:
$('.filter-options-item').collapsible({ collapsible: true})

but it's still collapsible.


texts:
For few orders, the order admin page is broken.

For other orders, page is working fine and normal without any issues.
XML ERROR while turning on php errors

Warning: simplexml_load_string(): Entity: line 16: parser error : XML declaration allowed only at the start of the document  in /var/www/html/lib/Varien/Simplexml/Config.php on line 510

#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/var/www/html/l...', 510, Array)
#1 /var/www/html/lib/Varien/Simplexml/Config.php(510): simplexml_load_string('loadString('loadFile('/var/www/html/a...')
#4 /var/www/html/app/code/core/Mage/Core/Model/App.php(380): Mage_Core_Model_Config->loadBase()
#5 /var/www/html/app/code/core/Mage/Core/Model/App.php(293): Mage_Core_Model_App->_initBaseConfig()
#6 /var/www/html/app/code/core/Mage/Core/Model/App.php(337): Mage_Core_Model_App->baseInit(Array)
#7 /var/www/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#8 /var/www/html/index.php(94): Mage::run('', 'store')
#9 {main}


texts: Problem with Magento 2 installation and JS/CSS files

texts:
I have been having problems with getting Magento2 installed on LAMP CentOS VPS.

I setup everything via terminal on a Mac, logged in as the web account user, so ownership should be fine.

I have installed composer, and that is how I have installed Magento.

I cloned it from here: git clone https://github.com/magento/magento2.git

Installed via composer: composer install

Updated via composer: composer update

Ran the installer via visiting the domain and running through each section, which went through fine.

On visiting the site (front end) i get lots of 404 errors on /pub/static/frontend/Magento/luma etc etc.

So i run the suggested permissions:

find . -type d -exec chmod 770 {} \; && find . -type f -exec chmod 660 {} \; && chmod u+x bin/magento

Which then give me this error: You don't have permission to access / on this server.

OK...

So i try different permissions:

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \;

Which then returns lots of 404 errors on /pub/static/frontend/Magento/luma etc etc again

Where am i going wrong?

I have scrapped and tried to reinstall around about 100 times. I've tried every tutorial, read every documentation i can find. Can anyone shed any light on this and why I am having so many issues?

Have i missed an important step of the installation or something?


texts: Change in JS file not reflected in Magento 2 frontend

texts:
I've changed a JavaScript file in Magento but changes are not reflected. I also cleared the cache but nothing changed.

So if anyone know why please help me.

Thank you.


texts: Want to change Feature Product Image Size in Magento 2

texts:
Hi i want to Create custom Featured Product in Magento 2. Below code use to get Product images:

$productImage = $block->getImage($_product, $image);
if ($pos != null) {
    $position = ' style="left:' . $productImage->getWidth() . 'px;'
        . 'top:' . $productImage->getHeight() . 'px;"';
}

echo $productImage->toHtml();

Currently Getting Image size as per Define in etc/view.xml in Theme, But i want to change Custom Image size for feature product in Homepage.


texts: Magento 2 Add customers grid in custom admin form

texts: I want to show customers grid in our custom admin form where I can select a particular customer so how to get this customer grid list in our form?


texts: Magento2 adminhtml_catalog_product_grid_prepare_massaction event is not observed

texts:
I am trying to observe this event:

Event Name : adminhtml_catalog_product_grid_prepare_massaction

Defined in : \vendor\magento\module-catalog\Block\Adminhtml\Product\Grid.php

$this->_eventManager->dispatch('adminhtml_catalog_product_grid_prepare_massaction', ['block' => $this]);

Here is my events.xml

app\code\Mypackage\Massproductaction\etc\adminhtml\events.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="adminhtml_catalog_product_grid_prepare_massaction">
        <observer instance="Mypackage\Massproductaction\Observer\Addmassactions" name="custom_add_massaction"/>
    </event>
</config>

Here is my observer

app\code\Mypackage\Massproductaction\Observer\Addmassactions.php

<?php
namespace Mypackage\Massproductaction\Observer;

class Addmassactions implements \Magento\Framework\Event\ObserverInterface
{

    protected $scopeConfig;
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
    ) {
        $this->scopeConfig = $scopeConfig;
    }

    /**
     * Execute observer
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
    public function execute(
        \Magento\Framework\Event\Observer $observer
    ) {
        exit("Should come here.");
    }
}

Few of other events are working fine.

As it is defined, why it is not working?
I want to add some dynamic mass-actions based on Settings (Configurations), so in this observer I will check the settings and will add to mass action to admin product grid.

I know it can be done with ui_component >> product_listing.xml

But as I told, I need it condition based.

Please help.
Thanks in advance.


texts: Magento 2: Use a model with a dynamic name through DI

texts:
i have one situation where i need to load need model dynamically

i followed below steps it work great same way like layersPool  in catalog module

but they used objectManager as per magento we should not use objectManager so please let me know how to solve this situation without objectManager,   we can solve this issue by sending data in di.xml as object instated of string but it will init all class when you call that layerpool so dont use object

di.xml

<type name="Magento\Catalog\Model\Layer\Resolver">
    <arguments>
        <argument name="layersPool" xsi:type="array">
            <item name="category" xsi:type="string">Magento\Catalog\Model\Layer\Category</item>
            <item name="search" xsi:type="string">Magento\Catalog\Model\Layer\Search</item>
        </argument>
    </arguments>
</type>

vendor\magento\module-catalog\Model\Layer\Resolver.php

<?php
/**
 *
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Catalog\Model\Layer;

class Resolver
{
    const CATALOG_LAYER_CATEGORY = 'category';
    const CATALOG_LAYER_SEARCH = 'search';

    /**
     * Catalog view layer models list
     *
     * @var array
     */
    protected $layersPool;

    /**
     * Filter factory
     *
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $objectManager;

    /**
     * @var \Magento\Catalog\Model\Layer
     */
    protected $layer = null;

    /**
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     * @param array $layersPool
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        array $layersPool
    ) {
        $this->objectManager = $objectManager;
        $this->layersPool = $layersPool;
    }

    /**
     * Create Catalog Layer by specified type
     *
     * @param string $layerType
     * @return void
     */
    public function create($layerType)
    {
        if (isset($this->layer)) {
            throw new \RuntimeException('Catalog Layer has been already created');
        }
        if (!isset($this->layersPool[$layerType])) {
            throw new \InvalidArgumentException($layerType . ' does not belong to any registered layer');
        }
        $this->layer = $this->objectManager->create($this->layersPool[$layerType]);
    }

    /**
     * Get current Catalog Layer
     *
     * @return \Magento\Catalog\Model\Layer
     */
    public function get()
    {
        if (!isset($this->layer)) {
            $this->layer = $this->objectManager->create($this->layersPool[self::CATALOG_LAYER_CATEGORY]);
        }
        return $this->layer;
    }
}

in needed place you can call

 $this->layerResolver->create('category');

in future add option in di and call it any where and also we can use get if you dont want create a object also

but how to solve this issue with out objectManager


texts: Magento 2 - What is the LayoutProcessor for addresses in the admin panel?

texts:
When adding a field to the address form of the checkout in the front end I could do so by creating a plugin for \Magento\Checkout\Block\Checkout\LayoutProcessor.

  I would like to add the same field to the admin panel address forms but cannot see the equivalent class.

Where can I find this?

<---Update--->

I should specify, one of the things that I want to do is change the template of the street fields.  As these fields have no name it does not seem possible to access them in the XML.


texts: I want to show actual price of product with discount price at invoice pdf

texts: Product Cheap special price is 9988, and it's actual price was 9999. i want to show actual price 9999 and discount price 9988 in the invoice. please help me. thank you.


texts: Magento 2: Use database of 2.0.4 in 2.0.7

texts:
I need to know if is it feasible to use the same database used in magento 2.0.4 in Magento 2.0.7 as both them are minor versions. i think it should work. But if there are any complications or any customization to be done. has anyone done it?
I think we can just update the version 2.0.4 using composer update but i want to use another installation with same copy of database.


texts: Are there any document or ebook for Magento Certification exam?

texts:
I'm gonna take Magento Certification exam in next 3 months to become a Magento Certified Developer, I've been searching for document for this exam. When I look at the study guide I see a lot of questions which I can answer, however the problem is I don't really know what they are expecting me to answer.

http://info.magento.com/rs/magentocommerce/images/Certification-Study-Guide-MCD-v1.pdf

I would like some materials that provide real experience on this exam (it's best if Ebook is written by Magento Certificated developer)

I highly appreciate any suggestion/recommendation on this. Thanks in advance


texts: What is replacement of include_once and require_once MEQP1 standard

texts:
Got these WARNINGS how can I resolve it ?

  "include_once" statement detected. File manipulations are discouraged.
  Concatenating is forbidden.

  "require_once" statement detected. File manipulations are discouraged.
  Concatenating is forbidden.

Code

include_once BP.DS.'app'.DS.'code'.DS.'core'.DS.'Mage'.DS.'Catalog'.DS.'Model'.DS.'Resource'.DS.'Attribute.php';


texts:
in cart page, you can see there is an option to find shipping charges by entering the zip code.

we removed "State" field, so its displaying like this now :

you can see country * "India".

I want to hide this. i done this by commented the related code in

 app/design/frontend/base/default/template/checkout/cart/shipping.phtml

now , its not calculating shipping charges when i entered zip code.

what is the correct procedure to hide & why shipping charges are not calculating when i hide the "country".

also its not displaying the message "Shipping is available or not"

ex: you can check here in cart page by adding this item to cart  link


texts: frontend and backend design not working after create multi store for multi language

texts:
Hello I want to create multi language site in magento2. I have follow particular magento2 tutorial.link that I have used. After I have follow command
1.php bin/magento indexer:reindex
2.php bin/magento cache:flush
3.php bin/magento setup:upgrade
4.php bin/magento cache:flush
5.php bin/magento setup:di:compile
6.php bin/magento cache:disable
to solve this issue I have given screenshot below for frontend and backend
front end

back end


texts: Magento creates two customer sessions with one browser for the same guest?

texts:
I'm using Magento 1.7.0.2.
And I have the Problem to access customer session data I set in different controllers.
I found out, that Magento generates two session files (in var/session/) when I load two different controllers of my own modules
where I set data to the “customer/session”!
So when I load content over the one controller, then I get the one customer session data from the first session file and when I load a cms page or the other controller I get the data of the other session file! How can that be?
I’m using the same browser all the time. Why does Magento think that there are two different users and generates two different customer session files when I load a different controller??? Additional I don’t work at this time with logged in customers...it’s all the time the guest customer session.

Has anybody any idea?

UPDATE:

I checked the difference between the user of the different sessions by logging the session id and the differences of my controller classes.
I found out that I used in one controller the “_construct” function to set some helper variables. And when I removed this usage Magento uses the other “correct” session. with the _construct, it used the other session id.
But I don’t know why.
Has anybody an Idea?


texts:
I am integrating survey js with Magento 2. Referring the below link.

https://surveyjs.io/Documentation/Library/?id=Add-Survey-into-your-Web-Page

But facing an issue:

  Uncaught ReferenceError: Survey is not defined

Anyone has an idea about it.


texts:
Where can i find the rest api for my orders and my downloadable products  in magento2. I can't find the list in the swagger file.

eg:
GET /orders/me
GET /downloadableproducts/me

Or how can i filter it based on existing api


texts: Hide add to Compare in category page beside add to cart

texts: I have been able to remove every link to add to compare but I cant get the one away that is placed beside the add to cart button on the category page.


texts: How to pass data as parameter with block function in ?

texts:
How to pass data as parameter with block function in below script:

<a target="_blank" class="title-store"
                       href="<?php echo $block->getBaseUrl() ?><%- data.rewrite_request_path %>"><%- data.store_name
                        %>

<%- data.address %>, <%- data.zipcode %> <%- data.city %>, <?php echo $block->getCountryname(data.country_id); ?>

                    Street View
                    Direction

In Above script, I am getting country code in this variable: data.country_id
when I trying to pass this varibale as parameter with block function, like <?php echo $block->getCountryname(data.country_id); ?> but it's not working.
Please help me, how can I pass the parameter with block function in correct way and where I am doing the mistake.
Any help would be appreciated

Thanks!


texts: Magento: Bypass Checkout for Free Products

texts:
I'm triying to create a new module to bypass checkout process for free downloadable products. As I'm not a developer I need some help with xml files of module.

I've this folder structure:

app/etc/modules/Fe_Freecheckout.xml

app/code/local/Fe/Freecheckout/controllers/CheckoutController.php app/code/local/Fe/Freecheckout/etc/config.xml

And these are the contents of files:

CheckoutController.php

<?php
public function purchaseAction() {
if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
        $this->_redirectUrl(Mage::getBaseUrl().'customer/account');
        return;
 }
 $request = $this->getRequest();
 $id = $request->getParam('id');
 $product = Mage::getModel('catalog/product')
                ->load($id)
                ->setStoreId(Mage::app()->getStore()->getId());
 if(!($product->getIsVirtual() && $product->getFinalPrice() == 0)){
     Mage::getSingleton('checkout/session')->addError($this->__('Method only available for Free Downloadable Items'));
     return $this;
 }
 $onepage = Mage::getSingleton('checkout/type_onepage');
 /* @var $onepage Mage_Checkout_Model_Type_Onepage */
 try{
     $quote = $onepage->getQuote();
     /* @var $quote Mage_Sales_Model_Quote */
     $quote->addProduct($product);
     Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
     $onepage->initCheckout();
     $payment=array('method'=>'free');
     $onepage->savePayment($payment);
     $onepage->saveOrder();
     $this->getResponse()->setRedirect('/downloadable/customer/products');
 }
 catch(Exception $e){
     $result = $e->getMessage();
     Mage::getSingleton('checkout/session')->addError($result);
 }
 }
 ?>

app/etc/modules/Fe_Freecheckout.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Fe_Freecheckout>

            <active>true</active>

            <codePool>local</codePool>

        </Fe_Freecheckout>
    </modules>
</config>

And this is app/code/local/Fe/Freecheckout/etc/config.xml:

<?xml version="1.0" encoding="UTF-8"?>

<config>
    <modules>
        <Fe_Freecheckout>
            <version>0.0.1</version>
        </Fe_Freecheckout>
    </modules>

    <global>
    <rewrite>
        <Fe_Freecheckout_checkout_onepagecontroller>
            <from><![CDATA[#^/checkout/onepage/#]]></from>
            <to>/Freecheckout/checkout_onepage/</to>
        </Fe_Freecheckout_checkout_onepagecontroller>
    </rewrite>
</global>
</config>

Then in product/view.phtml I use the following code to checkout:

<?php if($_product->isVirtual() && $_product->getFinalPrice()==0) { ?>
                <a href="/Freecheckout/checkout/purchase/id/<?php echo $_product->getId()?>"><?php echo $this->__('Download and Install') ?>
            <?php } ?>

I always get a Page not Found. Any directions, please?


texts: Magento 2.1.7, 2.2.3 : wrong placeholder image url

texts:
I try created new product without image after that view in frontend the image url not true. I inspect element the url of image not true.
.../media/product/placeholder/default/image.jpg lost catalog
the url true must be:
.../media/catalog/product/placeholder/default/image.jpg.

Edit
I checked:
- admin placeholder url is: ../media/catalog/product...
- frontend placeholder url is: ../media/product...
I don't understand why has difference in both.

I tried reindex and flush media cache but not change. please help me resolve this issue. Many thanks!


texts: Product import successful but not showing on frontend

texts:
I am testing M2 on a VM hosted on my local machine.

I have successfully imported products using a CSV file. The products appear in the correct categories in the admin area. However, they do not appear on the front end. I flushed the cache and they still didn't appear. I then went in to a couple of products and saved them then flushed the cache and those products appeared.

How do I get my recently imported products to show on the front end without having to save each one and flush the cache?


texts: region_id value when saving to customer address book

texts:
The following is some code to save an address to the customer address book... what value do I need to be putting in the region_id and is it needed?

  $_custom_address = array (
                        'firstname' => 'Honkey',
                        'lastname' => 'Joseph',
                        'street' => array (
                            '0' => 'Sample address part1 SECOND',
                            '1' => 'Sample address part2 SECOND',
                        ),
                        'city' => 'Orlando',
                        'region_id' => '',
                        'region' => 'MN',
                        'postcode' => '31000',
                        'country_id' => 'US',
                        'telephone' => '0038531555444',
                    );
                    $customAddress = Mage::getModel('customer/address');
                    //$customAddress = new Mage_Customer_Model_Address();
                    $customAddress->setData($_custom_address)
                                ->setCustomerId($customer->getId())
                                ->setSaveInAddressBook('1');
                    try {
                        $customAddress->save();
                    }
                    catch (Exception $ex) {
                        Mage::log('Could not save customer',null,'caitlin.log');
                        Mage::log($ex->getMessage(),null,'caitlin.log');
                    }


texts: Shipping cost not showing in Cart Review

texts:
I'm running Magento 1.9.0.1. I realized now that the shipping cost is not showing on the final review before buying. When the sales email is sent, it displays accurately the shipping, but on the review it doesn't appear (so people feel dissapointed)

I once installed MatrixRate extension, but then disabled it. I installed a fresh Magento over my old DB. The files are all new and there's no extension related to shipping installed (only 2 installed, and have nothing to do with it). I tried with the default template (because maybe I changed something there) but it's the same thing. The code isn't there, is not that it isn't showing, it just isn't there (if you go to View Source Code, there's nothing). I haven't changed anything on the template, and even tried with the default one and it's the same issue.

I'm thinking this has two options: the DB is corrupted, but that would be weird because I over-installed it with a fresh one, and also generally that has nothing to do with that, those are template issues.
The other option is that I changed something in the configuration but can't figure it out what could be.


texts: product count in layred navigation filter include only in stock products magento

texts:
Is there a way to show only in stock product count in shop by layered navigation filters? i need to show out of stock products in frontend, But not need to include its count in filters such as shop by price, shop by category etc.
Is there any possible way? i have checked the code. But struggling to achieve. Any help would be appreciated.


texts: Get product attribute on product/list page

texts:
Magento ver. 1.8.1.0, Ultimo theme

I'm trying to get product`s attribute according this solution:

Product Attribute on Products Grid/List View (manufacturer)

My settings:

I run following code:

<?php echo $_product->getAttributeText('depths'); ?>

Using xDebug I see following:

$this->getResource()

Resource instantiating well. I have this object

        ->getAttribute($attributeCode)

I got my attribute successfully

            ->getSource()

Before return I have following:

And on step:

                ->getOptionText($this->getData($attributeCode));

When we are getting $this->getData($attributeCode) result is NULL and ->getOptionText also return NULL

I don't know when this attribute should appear in $this (read as $product) ->getData() should have this value. If _data array have this value why don't I call just on list page $_product->getData('my_attr')?

Could you help me to find the issue?

p.s.

Mage::getModel('catalog/product')->load($_product->getId())->getDepths()

returns right value


texts: Add to cart mini icon on mobile not showing no. of products added on it

texts:
Earlier when we use to add products to cart, it use to redirect us to the checkout page, which we didn't wanted. So after the new settings now when we add products to cart it does to the mini cart on the top right side and there you can see the value on the mini cart like 1,2,3 (no of products added to card). This works smoothly on the desktop, but on the mobile the mini cart doesn't show any products no on the cart even after adding products to cart.

For more detail, i also checked using path finder. On desktop when i do this process the mini cart count comes from summary.phtml & on the mobile when i do the process the mini card is showing there is from header.phtml no summary.phtml linked to it. So how do i link it ?

How can i solve this, Please help me out thanks.

Here the screenshot for the mobile version, the cart icon is not showing any no. even after adding few products to cart.


texts:
I'm looking for a way to export product data and attributes from the product page via an export to PDF button. Are there any reliable extensions around as a solution?

I'm currently looking at the following 2 extensions:

Global PDF: http://www.boostmyshop.com/english/global-pdf.html

Magazento: http://www.magazento.com/english/magento-ext/magazento-extensions/pdf-export


texts: magento 1.9.2.1 image upload gets never completed

texts:
I read several posts but none of them has been useful. When I try to upload an product image, the uploader starts and goes up to 100% but then it turnes red, the image is not uploaded. If I try to upload the image not from product but from page, the upload seems to go fine but then the image is not shown in the folder and if I check the folder with filezilla I can see that the image is not there (so it's not been uploaded). Both ways, no error is shown, system and exception logs shows nothing. Magento version is 1.9.2.1, php is version 5.6 and gd is enabled. Permsision and user/group are correct.

Can anyone help me please?


texts: Magento 2: zend pdf anchor link not show in pdf file

texts:
I am using below code to show hyperlink in pdf file but link is not showing.Drawtext method works fine.It means hyperlink code is not working

$pdf = new \Zend_Pdf();
                        $pdf->pages[] = $pdf->newPage(\Zend_Pdf_Page::SIZE_A4);
                        $page = $pdf->pages[0]; // this will get reference to the first page.
                        $style = new \Zend_Pdf_Style();
$target = \Zend_Pdf_Action_URI::create('http://example.com', true);

             $annotation = \Zend_Pdf_Annotation_Link::create($x+250, $this->y-20, $x+400, $this->y-20, $target);
             $page->attachAnnotation($annotation);
             $page->drawLine($x+250, $this->y-10, $x+350, $this->y - 10);

In my above code line is showing but hyperlink not showing


texts: Uncaught Error: Call to undefined method Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor::getSchemaListener() after upgrading to 2.3.4

texts:
I just upgraded to 2.3.4 and get this message after running php bin/magento setup:db-data:upgrade:
PHP Fatal error:  Uncaught Error: Call to undefined method Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor::getSchemaListener() in C:\Sites\magento\setup\src\Magento\Setup\Model\Installer.php:939

OS is Windows Server 2016, in case it helps. Thanks in advance!


texts: Block with jQuery autocomplete in checkout page

texts:
How can I add jQuery autocomplete to checkout custom block?

Part of my js file code:

 if (...) {
   $(".hello").not(".red").hide();
   $(".red").show();
   var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp"];
   $(".hello").click(function () {
      $(".hello").autocomplete({
        source: availableTags
      });
   });
...

"I have removed the error message, because the answers I accepted is not solution to it."


texts: Magento $product->save() is slower part of script

texts:
In my Magento 1.9.1 I am updating the inventory via script. Via this script I update almost 19K products.
I have used $product=Mage::getModel('catalog/product')->load($id); to fetch the records and $product->save()  to save the products records. But $product->save() is the slowest part of the script.
Please let me what is the other method in Magento to fix this issue.

$stockItem = Mage::getModel('catalog/product')->load($id);
try {

    $stockItem->setStockData(array('is_in_stock' => $isinstock, 'qty' => $quantity));
    $weight_pro = ($length * $width * $height) / 166;
    if ($weight_pro < $weight) {
        $stockItem->setWeight($weight);
    } else {
        $stockItem->setWeight($weight_pro);
    }
    $stockItem->save();

} catch (Exception $e) {
    Mage::log('Failed for stockupdate  ' . $e);
}


texts: Magento 2: Fallback to JQueryUI Compat activated. Your store is missing a dependency for a jQueryUI widget due to domReady!

texts:
I am using Magento 2.3.3 in my project.  I am getting warning "Fall Back to JQueryUI Compat activated. Your store is missing a dependency for a jQueryUI widget. Identifying and addressing the dependency will drastically improve the performance of your site."
I googled and I found an issue with jquery/ui. However, I am getting the same issue with  domReady!.
Warning coming from comapt.js which loads all the library because it cannot  identify actual dependency
Can you guys help me? Please share dependencies need to load with domReady!.


texts: Fatal error when I go 'Manage categories' on admin

texts:
I'm getting a fatal error when I go 'Manage categories' on admin

It seems other menu working fine like manage products but manage categories is not work

  Fatal error: require_once(): Failed opening required 'Mage/Adminhtml/Block/Catalog/Category/Tabs.php' (include_path='/home/mywebsite/www/includes/src:.:/usr/local/lib/php') in /home/mywebsite/www/includes/src/Magedev_Productposition_Block_Catalog_Category_Tabs.php on line 8

What should I do to fix this error?


texts: How to get deal_price for each item in checkout cart

texts:
Each item in my checkout cart have deal_price. I want to get deal_price of each item. But it only get deal_price of first item.

$quote = Mage::getSingleton('checkout/cart')->getQuote();
        $discount = 0;
        if (Mage::getStoreConfigFlag('dailydeal/configuration/enabled')) {
            $resource = Mage::getSingleton('core/resource');
            $cartItems = $quote->getAllItems();
            $collection = Mage::getModel('catalog/product')->getCollection()
                ->addAttributeToSelect('*')
                ->joinTable($resource->getTableName('dailydeal_deal'), 'product_id = entity_id', array('deal_id' => 'deal_id', 'deal_price' => 'deal_price'), '{{table}}.status=1', 'inner');

            foreach ($cartItems as $item) {
                $productId = $item->getProductId();
                $qty = $item->getQty();
                $productPrice = $item->getPrice();
                echo $productPrice;
                echo "
";
                $deal = $collection->addAttributeToFilter('entity_id', $productId)->getFirstItem();
                $dealPrice = $deal->getDealPrice();

                echo($dealPrice);
                echo "
";

                $discount = ($productPrice - $dealPrice) * $qty + $discount;
                echo($discount);
            }


texts: Assign product to category programmatically Magento2 receive an error

texts:
I'm trying assign product to categories using code like there Assign products:

.........
$this->categoryLinkManagement->assignProductToCategories(
            $product->getSku(),
            $catIds
        );
............

but receive an error

Is it magento2 bug ? i use version 2.2.7


texts: Order Confirmation email: How to get order date with correct store timezone?

texts:
If I include the order date in my order confirmation email template via ...

Order Date: {{var order.created_at}}

..., the resulting order confirmation emails contain the order date in UTC/GMT time. I would prefer the date to be shown in the timezone configured for the store. How to do that?


texts: Gallery image(thumbnails) not changing on visual swatch Magento 2.4.1

texts: Is there any way to change the Gallery(thumbnail) image on visual swatch, currently only the base image get changed, I need to replace all the gallery image with selected product images


texts: how to make magento website avaliable only for registered users?

texts: Is that possible when a user visit on the website, its ask for login and then after login user will access the website. So basically only login user will access the website.


texts: Magento Search Order by Search Key word in name

texts:
I'm trying to order the search results based on the product name. For example
if we search using word "Cover Plate" the products which has cover plate in its name should show first.

I have already tried methods like adding
<input type="hidden" name="order" value="name"/> in  form.mini.phtml.

And tried editing Mage/CatalogSearch/Model/Resource/Fulltext.php
tried editing /Mage/CatalogSearch/Block/Result.php etc...

I think even if we use  its ordering the results. In above example the search is finding all the product with name cover plates and in its attributes and then ordering the those results based on name. So if there is a product name that starts with letter 'A' it will be listed first. Or may be its showing product which has search key word in its description first. My requirement is to show the product with name cover plate first. How can i do that. Which page i need to edit to accomplish this.

EDIT : Magento is giving importance to description while listing the products. Is there a way so that products with searched name can be listed first instead of description. Currently if there are matching words in the description then it is shown first.


texts:
I want to use distinct in magento.

SELECT DISTINCT level FROM `student`

I am trying this code

 $collection = Mage::getModel('school/student')->getCollection()
      ->distinct(true)
      ->addAttributeToSelect('level');

But its not working.

So how to use distinct in magento


texts: How to create business profile in Magento 2.3.2 community edition. I need to add one more account other than customer account in the top links.


texts: I'm trying to load/set/restore an old quote from a customer when they log in, but the thing is not that simple, because it turns out that I'm using Cminds Multi User Account Extension, and the project required to create a user/account switcher when logging in as a Parent account and I've already got this covered, the issue that I have now is that all customers are sharing the same cart, and it happens when switching between accounts. I've fiddled with some checkoutSession methods such as clearQuote(), loadCustomerQuote() and even trying to obtain from the quoteCollection, the last quote that the user had and using the replaceQuote($customerQuote) method to replace it, but so far I've had no luck, the cart is still being the same for each customer (parent and childs) when I switch between them. Am I doing the wrong approach? is there an event that I can listen to with an observer? or is there a method that I can intervene using a plugin? Any help would be greatly appreciated.


texts:
I'm trying to filter my product search by returning only products within the current category I'm in, I can't find where the product collection is created within the search module

Can anyone help point me in the right direction?


texts: Update quantity of products in cart to the max available if quantity entered is greater than

texts:
So we've implemented a modification to the product quantity update in cart based on this solution from Demac Media.

If the customer tries to update the quantity of a product in cart that is greater than the available quantity then the idea of this modification is to set the quantity to the maximum available for that product.

Copy...

/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php

To...

/app/code/local/Mage/CatalogInventory/Model/Stock/Item.php

Modify function checkQuoteItemQty($qty, $summaryQty, $origQty = 0)

Find on line 589 (Magento 1.7), change...

if (!$this->checkQty($summaryQty) || !$this->checkQty($qty)) {
        $message = Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available.', $this->getProductName());
        $result->setHasError(true)
            ->setMessage($message)
            ->setQuoteMessage($message)
            ->setQuoteMessageIndex('qty');
        return $result;

To...

if (!$this->checkQty($summaryQty) || !$this->checkQty($qty)) {
        $message = Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available. However, we have added the available quantity to your basket.', $this->getProductName());
        $result->setHasError(false)
    ->setOrigQty($this->getQty())
            ->setMessage($message)
            ->setQuoteMessage($message)
            ->setQuoteMessageIndex('qty');
        return $result;

This is working great for products without any options, but if a associated product of a configurable is added to the cart, updating the quantity to one of which is greater than the available in inventory continues to yield the error message and doesn't update to the maximum available.

Any idea's on why the function modification above would not be working for associated products in the cart? Thanks in advance.


texts:
Following directions from Magento Documentation for Command-line upgrade to Magento 2.1. Running into some errors when data is upgrading. Below are the errors i receive after running the upgrade command.

[Zend_Db_Statement_Exception]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-Images' for key 'EAV_ATTRIBUTE_GROUP_ATTRI
  BUTE_SET_ID_ATTRIBUTE_GROUP_NAME', query was: UPDATE `eav_attribute_group` SET `attribute_group_name` = ? WHERE (`a
  ttribute_group_id`=10)

  [PDOException]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-Images' for key 'EAV_ATTRIBUTE_GROUP_ATTRI
  BUTE_SET_ID_ATTRIBUTE_GROUP_NAME'

Any insight would be appreciated


texts: Set default shipping method as table rate and not free shipping

texts: I have two shipping method`s first is free shipping and second is table rate. I want to set the default shipping method as table rate and not as free shipping. how can we set it? Thanks in advance!


texts: How do I enable UPS/shipping.log for debugging in Magento 2.3.3?

texts:
I have enabled debug mode in Stores > Configuration > Sales > Shipping Methods > UPS > Debug "Yes" and I am not seeing a shipping log file in my  var/log folder.
Is this log only available when in developer mode? How do I enable the log file properly for the UPS shipping method?


texts: Automatic random generation field "username"

texts:
I've created in website extra customer field: Username

Does anyone have any solution to automatically generate this field with username immediately after registration?
I see some like this:
https://www.rakeshjesadiya.com/how-to-generate-random-string-or-number-in-magento-2/
can anyone help me how can i implement it?


texts: The page isn't redirecting properly - after upgrade from 1.7 to 1.9

texts:
I have recently upgraded from 1.7 to 1.9 and now if I go to login or checkout, customer account ect I get the following error:

  The page isn't redirecting properly

  Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

Admin works fine. Any Ideas what could be causing this?

I used these instructions :

magento-how-to-safely-upgrade-from-1-7-to-1-9
streetdecals.co.uk


texts: Unable to call a block from template file

texts:
I have a custom module and created a block handle in my configuration file as below

    <blocks>
        <onestepcheckout>
            <class>Ucs_OneStepCheckout_Block</class>
        </onestepcheckout>
        .
        .
        .
    </blocks>

Then created a block file inside app/code/local/ucs/OneStepCheckout as below

<?php
class Ucs_OneStepCheckout_Block_Review extends Mage_Core_Block_Template
{
    public function getReviewTemplate()
    {
        return 'Success';
    }

}

Then trying to create the getReviewTemplate from theme/checkout/onepage.phtml as below

$block=$this->getLayout()->createBlock('onestepcheckout_review')->getReviewTemplate();
                echo '<pre>'; print_r($block);

It throws the error as below

  Fatal error: Call to a member function getReviewTemplate() on a non-object

What is the wrong with my code?


texts: Getting a 500 internal server error :: Back-end >> System >> Tools >> Backups

texts:
I am trying to take a Backup of My server from the admin panel . Using following options

System >> Tools >> Backups >> System Backup

It gives the popup to mention the name of the file of the backup and gives a loader for some time . Then it gives me a 500 internal error.

The error stays  untill i change the permission of the index.php to 655 .

I request you please provide me the reason behind this error and solution for the same.

Thanks in advance.


texts: Magento 2 - Mobile View Layered Navigation move to top

texts:
I have a magento 2 store which has over 100 products displayed with additional filters for the layered navigation.
I just want to move these filters to the top on mobile as currently they are at the bottom below all the products.
I have searched and found how to do this but it happens on both desktop and mobile and I need some help and guidance to make it work on mobile only and stick to the left on desktop.
Any help appreciated


texts: Magento 2: How to remove Theme block in admin?

texts:
How to remove this block in back-end

Categories > Design > Theme block
New product > Schedule Design Update > New Theme block

thank you!


texts: How to Override Mage_Checkout_Block_Links

texts:
What is the proper way to override a method, for example, the Mage_Checkout_Block_Links::addCartLink() method.

My goal is to add some HTML before the Mage_Checkout_Block_Links::addCartLink() method. However, I don't know where to begin or which file to copy and edit under my custom theme.

I am thinking about something like this:

public function addLink($beforeText='<i class="icon-shopping-cart"></i>')


texts: Make payment method visible only in admin only

texts: I would like to make the Purchase Order method of payment accessible only in admin order creation, and not visible in the front end checkout process.I am using the rwd theme and do not program so please be clear which files I need to amend and where if possible. Thank you.


texts: how to include css file to templates (.phtml file )in magento 2?

texts:
I wanted to place the contents of style tag in a seperate folder and wanted to include it into this customtext.phtml file.

How can I do this?


texts:
Magento 2 should have an option for flat rate shipping in

stores -> config -> sales -> shipping methods

My install  missing this option. There are 2 shipping methods available: Fedex and UPS, which are both enabled in the Component Manager. I'm using Magento 2.0.4

I can't find any component in the Component Manager that looks like it might have anything to do with flat rate shipping.

My client only has one shipping method, a flat rate £15 per order and that's what I want to set up.

Is there something wrong with my setup?
Otherwise please can someone tell me how to set up the flat rate?


texts: Implement custom options into the frontend for grouped, simple products

texts:
Synopsis
As per a previous question I have asked (which for now is irrelevant, although an indication to this question).  I have a Grouped Product with associated Simple Products these associated simple products also have custom options (The options are not required).
The moment I add custom options to my Simple Products' they disappear from the Grouped Product view (within the table of associated products).  The moment I remove the custom options, the product is visible to the frontend henceforth, that said the same goes for the Associated Products Grid in the back-end.
The above is explained furthermore in my previous question.
The goal
Is to use a Helper to generate the product options' fields in a table row below the Simple Product on the Grouped Product view for associated products that have been given Custom Options.
My attempts
So I created a custom module and helper to query the database for the options and their values for a given product - now I wish to set the option data to the product, but I don't know how to, neither can I find any useful resources.
Although I am aware of $product = $product->load($product->getId()); In my opinion, this is hacky to generate a heavy query n times on top of the already heavy query to get the associated products fields and grouped products' information.  Even If I did use this method, my problem still exists I cannot place the Custom Options fields in my view.
If it helps, I used grep as per usual and discovered container2 but I could not find anything about what this is; how it is configured; how it is generated; how to use it; etc.
Example
<?php

class My_Catalog_Helper_Product extends Mage_Core_Helper_Abstract
{
    public function getOptions(Mage_Catalog_Model_Product $product)
    {
        $resource = Mage::getResourceModel('catalog/product_option_collection');
        $select   = $resource->getOptions(Mage::app()->getStore()->getId())
            ->getSelect()
                ->where('`main_table`.`product_id` = ?', (int) $product->getId());

        # XXX - Attempt 1 - returns the right value but the array keys are not
        # option_id but an empty sting.
        $options = Mage::getModel('catalog/product_option')
            ->setProductId($product->getId())
            ->setStoreId($product->getStoreId())
            ->addData($resource->load()->getItems());

        $product->addOption($options);
        var_dump($product->getOptions());die;

        # XXX - Attempt 2 - The options returns an empty array - this is inconsistent
        # to the normal way of set<PropertyName>( $params ) - setData as we know clears
        # any existing data for the $params - so is not what I want.
        $product->setOptions($options);
        var_dump($product->getOptions());die;

        # XXX - Attempt 3 - returns the same as above with the correct option_id
        # as the key of the option instance.
        $options = array();
        foreach ($resource->load()->getItems() as $optionId => $option) {
            $options[$optionId] = $option;
        }

        # XXX - This appears to be the result that I expect, but I cannot add this to
        # my product, how can I do this?
        var_dump($options);die;

        # XXX- This next block was a test to get the values for the options but I don't
        # know if this is necessary or even how to apply this.
        $resource = Mage::getResourceModel('catalog/product_option_value_collection')
            ->addOptionToFilter(array_keys($options))
            ->load();

        $data = array();
        foreach ($resource->getItems() as $optionValueId => $option) {
            $optionId = $option->getOptionId();
            $data[$optionId] = $optionValueId;
        }

        # XXX Again I don't know what to do with this yet.
        $product->setOptions($data);
        var_dump($product->getOptions());die;

        return $options;
    }
}


texts: I accidently deleted all the records from magento admin_role , admin_rule , admin_user, i want to login to my magento admin panel. tell me how to re-insert the records. or any solution.


texts: Magento 2 After upgrade 2.1.7 to 2.2.7 Element 'block', attribute 'remove': The attribute 'remove' is not allowed error throw

texts:
After upgrade magento2.1.7 to magento 2.2.7 following error show.How to solve it .

  1 exception(s):
  Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'remove': The attribute 'remove' is not allowed.
  Line: 785

Following is a screen shoot:


texts: Magento 1.9.2 - Encrypt the password from the php file

texts:
I created a file for sending the email from my site in php via SMTP. To do this I followed a guide where he said that you had to write as text in the sending file (MailSMTP.php) both the email address and the password of the account from which you want to start the emails.

My question is: How can I hide the password in my php file in such a way that if a user tracks my php file (MailSMTP.php) can not read the text of my password in frontend?

The code that I would like to obscure from the php file is this:

$password = "xxxxxxx";


texts:
I am trying to override _toHtml() method of class Mage_CatalogSearch_Block_Autocomplete like below :

app/etc/modules/Custom_Autocomplete.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Custom_Autocomplete>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_CatalogSearch/>
            </depends>
        </Custom_Autocomplete>
    </modules>
</config>

app/code/local/Custom/Autocomplete/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Custom_Autocomplete>
            <version>0.1.0</version>
        </Custom_Autocomplete>
    </modules>
    <global>
        <blocks>
            <autocomplete>
                <class>Custom_Autocomplete_Block</class>
            </autocomplete>
            <catalogsearch>
                <rewrite>
                    <autocomplete>Custom_Autocomplete_Block_Autocomplete</autocomplete>
                </rewrite>
            </catalogsearch>
        </blocks>
    </global>
</config>

app/code/local/Custom/Autocomplete/Block/Autocomplete.php

<?php

class Custom_Autocomplete_Block_Autocomplete extends Mage_CatalogSearch_Block_Autocomplete {

    protected function _toHtml() {
        // My Custom Code
    }

}

This is not working.

Mage_XmlConnect_Block_Catalog_Search_Suggest is already extending Mage_CatalogSearch_Block_Autocomplete. Now, how can I extend Mage_CatalogSearch_Block_Autocomplete and override _toHtml()

Please help me out to make it work.


texts: filter search is visible with some brands and need to be visible to all brands

texts:
We have a category brands, and with some brands the filter search is visible and with some brands it is not visible.
How can I change this so filter search is visible to  all brands?


texts: Adding custom static block in footer issue in magento 2

texts:
I tried to add some static blocks in the footer: <referenceContainer name="footer-container" from xml and it's not working.

But if I add in: <referenceContainer name="before.body.end"> after name="absolute_footer" it's working.

This is my code:

<referenceContainer name="footer-container">
    <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="footer content">
        <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/>
        <block class="Magento\Framework\View\Element\Html\Links" name="footer_links">
            <arguments>
                <argument name="css_class" xsi:type="string">footer links</argument>
            </arguments>
        </block>
        <block class="Magento\Cms\Block\Block" name="basket_rent">
            <arguments>
                <argument name="block_id" xsi:type="string">basket_rent</argument>
            </arguments>
        </block>
        <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/>
        <block class="Magento\Framework\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" />
    </container>
</referenceContainer>
<referenceContainer name="before.body.end">
    <block class="Magento\Theme\Block\Html\Footer" name="absolute_footer" template="html/absolute_footer.phtml" />
    <block class="Magento\Cms\Block\Block" name="basket_rent">
        <arguments>
            <argument name="block_id" xsi:type="string">basket_rent</argument>
        </arguments>
    </block>
</referenceContainer>

My block's identifier is: basket_rent.

Please Help and thank you.


texts: I would like to set a category by default to one product because we can find it in several categories. eg: In Apple > iPhone et in Smartphones. How I could do that please?


texts: Magento product import category mismatch

texts:
we have export the product in magento admin panel and changed the products details and import to products. its working fine. But some category id not inserted to table.
We have checked with the excel sheet, there is category  field in comma separated. My thought is comma is the problem. How to identify the issues?


texts: Ajax tabs for configurable product with description of child products

texts: I need to create custom tab in configurable product that will check is there a description in child product that is selected now and load description of child product. So for example in configurable product i select color: Red, after this, it should check, does this child product have description, if yes, load custom tab with description. Any suggestions even extension would be nice, thank you.


texts: Magento 2 setting base image on all store views via REST API does not change base image for specific store on production mode

texts:
I have a magento 2.2.6 installation with 2 store views, i am setting the base image via the REST API using the /rest/all/V1/ endpoint.

In developer mode changing the base image updates the base image on both the 'All store views' and the specific storeviews, but in production mode the update only works in 'All store views', and the specific store views still have the old base image.

Could this be a Magento issue or am I misunderstanding the all storeview? The only way I can successfully update the base image on all store views right now is by separately calling the API once for each store code.


texts: Magento 2 bind param to query in order by clause

texts:
I'm trying to bind params to order by with expressions clause in Magento 2, my insecure code looks like:

$order = new \Zend_Db_Expr("POW((main_table.long - $this->_coordinates['lat']), 2) + POW((main_table.lat - {$this->_coordinates['lat']}), 2)");

                $stores->getSelect()->order(array(
                    $order,
                    'main_table.title ASC'
                ));

How could I bind both variables to the query?


texts: Error Warning: file_put_contents(/var/www/html/var/cache//mage-tags/mage---792_CONFIG): failed to open stream: Permission denied

texts:
Magento 2 below the Warning come.

Warning: file_put_contents(/var/www/html/var/cache//mage-tags/mage---792_CONFIG):
failed to open stream: Permission denied in /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php on line 663

Please Help.

After changing permissions I got an error "Class Magento\Review\Model\ReviewFactory does not exist"

Ok, I fixed above error by deleting generation folder and making static content deploy


texts:
I am having problem when moving to new server use Ubuntu.
All my controller when loading grid/listing using UI component  goes to 404 with no-route:

That is example:

domain.com/wondergopher/admin/noroute/index/key/1dc2621593818c8437bda5d4cd3e747a1759782801db68ce1a41a2d88a2ef544/
Request Method:GET
Status Code:
404
Version:HTTP/1.1
Referrer Policy:no-referrer-when-downgrade

Example product grid:

Also, I don't see any log/error via  folder var/ so that is difficult to check.
Anyone know this issues can help me?


texts: How can I set priority of my new tab in sale order view Magento 2

texts:
I have created new tab for order view, but it will display at first . How can I set priority for display at last

I have used below code for add new tab

<referenceContainer name="left">
            <referenceBlock name="sales_order_tabs">
        <action method="addTab">
                    <argument name="name" xsi:type="string">*****_****</argument>
                    <argument name="block" xsi:type="string">******\*****\*****\****\****\****\****</argument>
        </action>
            </referenceBlock>
        </referenceContainer>


texts: how to make additional flat tables columns search in catalogsearch_fulltext?

texts:
It is required to make additional custom tables ( custom created flat models) search, based on basic search query, if filter input box is checked at the layered filter navigation.

If this was persistent requirement I would override _prepareProductIndex of Mage_CatalogSearch_Model_Resource_Fulltext in my module, to add data from my custom tables into index, but this is optional requirement, and I wonder, how to patch the search query properly ?

I came up with idea to register custom value in Mage::registry in custom filter, and if it exists, make modification to the search query.

Any ideas would be appreciated.


texts: Magento 2 : How to get postcode from selected shipping addresses in checkout page?

texts: How we can get the value of postcode from selected shipping addresses on checkout page if a customer has multiple addresses?


texts: Magento2 error does not have corresponding setter in class "Magento\Checkout\Api\Data\ShippingInformationExtensionInterface"

texts:
I have added custom filed in quote and order table,
when ever i want to save i get

Property "MetroTimeSlot" does not have corresponding setter in class "Magento\Checkout\Api\Data\ShippingInformationExtensionInterface"

i have already added metro_time_slot in extension_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Checkout\Api\Data\ShippingInformationInterface">
    <attribute code="metro_time_slot" type="string"/>
</extension_attributes>


texts: Magento 2 - Curl Method coding standard?

texts:
I am calling third party API using below methods:

$ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->_url . 'api/v1/ShipTos');
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer $session", "Content-Length: " . strlen($data_string)));

        $out = curl_exec($ch);

How to call curl method in Magento 2 with example please?


texts:
I'm trying to add a new extra "add to cart" called (Send as a gift)  button in product view. The functionality of this button has to be a little different than the original button. When i press this second button , it has to redirect directly to checkout .

I mentioned that the original button is not redirect. So , in conclusion , first button does not need to redirect you to checkout, but the second it is necessary.

Can anyone can give me some ideas , how to do this?  I am using magento 1.9
Thanks in advance!


texts: Admin Payment Method after an Upgrade 2.2.5

texts:
Admin > Configuration > sales > Payment Method after an upgrade to 2.2.5,

the page display this form with no active control, How to resolve this? (Please see picture below)

Thank you in advance.


texts:
All of the zip files downloadables from my site are being corrupted.

Looking for answers online I always find the same result: To edit htaccess because it is double compressing the files. I'm quite certain this is the problem as if I go to the link directly it works, and if I upload a zip file uncompressed, it works.

I have tried editing my htaccess to match the code below but it does not seem to work!?

• Do I need to place an htaccess file with that right in the /downloadable directory?

• Could I use an external link as a download, i.e through dropbox or something?

    # php_flag zlib.output_compression on # problems with downloadable content

...
...
...

# Insert filter on all content
### SetOutputFilter DEFLATE # problems with downloadable content
# Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

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

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

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

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

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


texts: Magento connect Manager will not unisntall an extesion

texts:
I used Magento Connect Manager to install this quick view extension called Dolphin_QuickWatch.  It installed, but I couldn't get to function, so i decided to remove it.  I went back to Magento Connect Manager and when I click on Uninstall it displays the Magento Connect Manger Log In page again instead of removing it (picture attached).

How Can I remove this extension and why is this happening? Any ideas?


texts: How can I add new Class in Magento2 sales grid?

texts:
I was trying to add new class in Sales order grid in table rows based on some conditions in admin of Magento2 but I couldn't succeed.

Can anyone help me out how to do such thing?

please find attached screen shot for your reference:


texts: Magento cache - how to disable this singleton(page identifier) cache?

texts:
When cache is disabled, Mage::getSingleton('cms/page')->getIdentifier(); is working fine and i am getting correct page identifier for all pages.

But when cache is enabled, it is always returning the page identifier that's loaded first.

I am calling it in phtml files. Should it work fine in block classes?

Any workaround?

Update:

Actually all code are being cached somehow AND I cant see any output of new code unless I flush or disable cache. So this does not seem to be an issue of this particular singleton object. On same server, another magento installation/project is fine with cache enabled and I can see uptodate immediately. I am looking into the issue. It might be any other setting or the theme that has come up with some extensions.


texts: Magento 2.3.2: Reorder in frontend does not work with custom theme

texts:
When I try to reorder an order and I click "Reorder" in my frontend I get the error:
Error 404 Page not found
In admin->stores->configuration->sales Allow reorder is enabled
I found out, thats a problem with my theme. If I change my theme to luna, it works. Which files I have to add, or do I have to edit the parent theme?


texts: Adobe documentation says there should be a gateway URL present inside DHL carrier however it's missing in our installation. Please help.


texts: Bluefoot page builder not present when editing content on Schedule New Update

texts:
We installed Bluefoot plugin on our Magento 2 website. It provides easy and fast content management for the client, on pages and blocks. But when client want to make content on  "Schedule New Update" modal, there are no Bluefoot button that should enable/disable the plugin.

Is this expected behaviour, and is there any way to make this plugin working with Schedule Update content field?

Magento ver. 2.2.3
Bluefoot ver. 1.0.31


texts: Can't Embed Image on Magento Product description page

texts:
Often this community is my destination for many issues. Recently we are facing an issue with our Magento 1.9.3 store after upgrading it from 1.7.x when we try to embed a picture or anything on the product description page. It never loads the popup correctly as this picture-

When we try to upload a picture on the product description
click the Insert/Edit image button
Popup comes but never complete where we can finish it.

I will really appreciate and will be grateful if someone advises how we can solve this issue.

Thank you so much in advance.


texts:
I created layout XML file for 2columns-left layout.
I need to use two options 2columns-left and 2columns-right in system configuration.
When admin selects 2columns-right it should set layout on Right side and vise versa.

How should i proceed?


texts: Default Tax Rate not applied to Denmark order

texts:
We have the Default Tax Destination Calculation in Configuration -> Sales -> Tax set as United Kingdom for the country then * in State and Post code.

VAT is all set up for the UK and working as it should. We have no other Tax rates or zones set up.

We have just had an order from Denmark, and the system has not applied VAT to the order. But the default Tax rate is set to the UK so it should have added VAT by default.. Any idea why it sis not?

Have we got another setting somewhere set up wrong?


texts: Products do not appear on list page in magento 2?

texts:
I am working on a project where I need to display the list products on list page. I have added the products on local server where I am getting them on front-end. But when I create products on live site. I am getting

  "Available Stock:0"

in Magento 2.3.

When I went to check the n.o of products in list.phtml using count() function it return 0. But on local it return right value and display the products as well.

I have tried Reindexing as well but got no luck. Kindly help me out!!!
If you need further clarification please let me know.


texts: Wishlist - Add all to cart goes to 404 page instead

texts:
When I click "Add All to Cart" on the wishlist page, I get a 404 error and the address in the bar is http://www.blahblahblah.com/wishlist/index/allcart/. The items are not added to cart.

A slightly different error occurs if I "Add all to Cart" from the share wishlist email, it then just goes straight to homepage.

I am using Magento CE v1.9.1.0 with unchanged version of /template/wishlist/view.phtml and have not changed any core files.

It looks like it's getting the wrong url?


texts: How can we get stock data in product listing via afterGetList plugin in Magento 2.2.3

texts:
Since magento 2.2.3 is displaying out of stock items in product listing, I would like to get the qty attribute in the listing using rest API. I'm using afterGetList plugin.

di.xml

<type name="Magento\Catalog\Api\ProductRepositoryInterface">
    <plugin name="get_product_metrics" type="Custom\Module\Plugin\ProductGet"/>
</type>

Custom/Module/etc/extension_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Catalog\Api\Data\ProductInterface">
        <attribute code="qty" type="string"/>
    </extension_attributes>
</config>

ProductGet.php

 <?php

namespace Custom\Module\Plugin;

use Magento\Catalog\Api\Data\ProductInterface;

class ProductGet{
protected $productExtensionFactory;
protected $productFactory;

public function __construct(
    \Magento\Catalog\Api\Data\ProductExtensionFactory $productExtensionFactory,
    \Magento\Catalog\Model\ProductFactory $productFactory,
    \Magento\CatalogInventory\Api\StockStateInterface $stockItem,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface $mediaGallery,
    \Magento\Eav\Model\Config $eavConfig
)
{
    $this->productFactory = $productFactory;
    $this->storeManager = $storeManager;
    $this->logger = $logger;
    $this->stockItem = $stockItem;
    $this->productExtensionFactory = $productExtensionFactory;
    $this->eavConfig = $eavConfig;
    $this->mediaGallery = $mediaGallery;
}

public function afterGet(
    \Magento\Catalog\Api\ProductRepositoryInterface $subject,
    \Magento\Catalog\Api\Data\ProductInterface $product){

    $this->logger->info("Inside AfterGet ");

    $imageUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);

    if($product->getImage()){
        $product->setCustomAttribute("image", $imageUrl.'catalog/product'.$product->getImage());
    }

    return $product;
}

/**
 * @param \Magento\Catalog\Api\ProductRepositoryInterface $subject
 * @param \Magento\Catalog\Model\ResourceModel\Product\Collection $products
 * @return \Magento\Catalog\Model\ResourceModel\Product\Collection
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
    public function afterGetList(
    \Magento\Catalog\Api\ProductRepositoryInterface $subject,
    $products
    )
    {
        $this->logger->info("list: ".json_encode($products->getItems()));
        /** @var  $product */
        foreach ($products->getItems() as $key => $product) {
            $qty = $this->stockItem->getStockQty($product->getId(), $product->getStore()->getWebsiteId());
            $extensionattributes = $product->getExtensionAttributes();
            $extensionattributes->setQty($qty);
            $product->setExtensionAttributes($extensionattributes);
        }
        return $products;
    }
}

Can anyone help on this? Thanks in advance!


texts: How to filter products using category_id and brand in magento soap API v2

texts:
I have created a function to filter products by brands as follows:

$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'manufacturer',
            'value' => array('key' => 'like', 'value' => $brand_id)
        ),
        array(
            'key' => 'name',
            'value' => array('key' => 'like', 'value' => '%'.$name_keyword.'%')
        )
    )
);

$result = $soapClient->catalogProductList($sessionId, $complexFilter);
var_dump ($result);

This function return correct data.
but when I used category_ids in complexFilter it return me exception.

My Custom function for filter by brands and category_ids is as follows:

$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'category_ids',
            'value' => array('key' => 'in', 'value' => array("353"))
        ),
        array(
            'key' => 'manufacturer',
            'value' => array('key' => 'like', 'value' => $brand_id)
        )
    )
);

$result = $soapClient->catalogProductList($sessionId, $complexFilter);
var_dump ($result);

And Exception are :

{"faultstring":"Call to a member function getBackend() on a non-object","faultcode":"SOAP-ENV:Server"}

How to filter products using category_id and brand in Magento SOAP API?


texts: How many levels of sub-categories can be created?

texts:
Surprisingly I couldn't find an answer with a bit of googling. I am really trying to understand the level of categories and nested subcategories that magento allows.

Thank you,
Andy


texts:
I'm trying to make different page where i need PHP. thats why i use a phtml file. I don't want to make any changes to the other Magento layouts so I just want to include the phtml file via the CMS.

I've made a phtml file in: mycustomtemplate/template/page/page.phtml

that file contains just 'test'.

then I've tried to call in the magento CMS->new page->content tab with:

{{block type="core/template" template="page/page.phtml"}}

but nothing shows up. Is there any way to do this? And how..


texts: How can I add a total qty column in the product grid in Magento 2?

texts:
I'm using MSI and I would like to add a column that shows the total qty of a product in all sources. So basically a sum of the qty in all sources.
So let's say that currently one product shows
WAREHOUSE_X SALEABLE QTY = 2
WAREHOUSE_Y SALEABLE QTY = 4
I would like to add a TOTAL QTY column saying 6.
Any ideas?